Warning, file /include/boost/units/homogeneous_system.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_UNITS_HOMOGENEOUS_SYSTEM_HPP_INCLUDED
0012 #define BOOST_UNITS_HOMOGENEOUS_SYSTEM_HPP_INCLUDED
0013
0014 #include <boost/mpl/bool.hpp>
0015
0016 #include <boost/units/config.hpp>
0017 #include <boost/units/static_rational.hpp>
0018
0019 #ifdef BOOST_UNITS_CHECK_HOMOGENEOUS_UNITS
0020
0021 #include <boost/type_traits/is_same.hpp>
0022 #include <boost/mpl/not.hpp>
0023
0024 #include <boost/units/detail/linear_algebra.hpp>
0025
0026 #endif
0027
0028 namespace boost {
0029
0030 namespace units {
0031
0032
0033
0034
0035
0036
0037
0038
0039 template<class L>
0040 struct homogeneous_system {
0041
0042 typedef L type;
0043 };
0044
0045 template<class T, class E>
0046 struct static_power;
0047
0048 template<class T, class R>
0049 struct static_root;
0050
0051
0052 template<class L, long N, long D>
0053 struct static_power<homogeneous_system<L>, static_rational<N,D> >
0054 {
0055 typedef homogeneous_system<L> type;
0056 };
0057
0058
0059 template<class L, long N, long D>
0060 struct static_root<homogeneous_system<L>, static_rational<N,D> >
0061 {
0062 typedef homogeneous_system<L> type;
0063 };
0064
0065 namespace detail {
0066
0067 template<class System, class Dimensions>
0068 struct check_system;
0069
0070 #ifdef BOOST_UNITS_CHECK_HOMOGENEOUS_UNITS
0071
0072 template<class L, class Dimensions>
0073 struct check_system<homogeneous_system<L>, Dimensions> :
0074 boost::mpl::not_<
0075 boost::is_same<
0076 typename calculate_base_unit_exponents<
0077 L,
0078 Dimensions
0079 >::type,
0080 inconsistent
0081 >
0082 > {};
0083
0084 #else
0085
0086 template<class L, class Dimensions>
0087 struct check_system<homogeneous_system<L>, Dimensions> : mpl::true_ {};
0088
0089 #endif
0090
0091 }
0092
0093 }
0094
0095 }
0096
0097 #if BOOST_UNITS_HAS_BOOST_TYPEOF
0098
0099 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
0100
0101 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::homogeneous_system, (class))
0102
0103 #endif
0104
0105 #endif