123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- #ifndef BOOST_UNITS_HOMOGENEOUS_SYSTEM_HPP_INCLUDED
- #define BOOST_UNITS_HOMOGENEOUS_SYSTEM_HPP_INCLUDED
- #include <boost/mpl/bool.hpp>
- #include <boost/units/config.hpp>
- #include <boost/units/static_rational.hpp>
- #ifdef BOOST_UNITS_CHECK_HOMOGENEOUS_UNITS
- #include <boost/type_traits/is_same.hpp>
- #include <boost/mpl/not.hpp>
- #include <boost/units/detail/linear_algebra.hpp>
- #endif
- namespace boost {
- namespace units {
- template<class L>
- struct homogeneous_system {
-
- typedef L type;
- };
- template<class T, class E>
- struct static_power;
- template<class T, class R>
- struct static_root;
- template<class L, long N, long D>
- struct static_power<homogeneous_system<L>, static_rational<N,D> >
- {
- typedef homogeneous_system<L> type;
- };
- template<class L, long N, long D>
- struct static_root<homogeneous_system<L>, static_rational<N,D> >
- {
- typedef homogeneous_system<L> type;
- };
- namespace detail {
- template<class System, class Dimensions>
- struct check_system;
- #ifdef BOOST_UNITS_CHECK_HOMOGENEOUS_UNITS
- template<class L, class Dimensions>
- struct check_system<homogeneous_system<L>, Dimensions> :
- boost::mpl::not_<
- boost::is_same<
- typename calculate_base_unit_exponents<
- L,
- Dimensions
- >::type,
- inconsistent
- >
- > {};
- #else
- template<class L, class Dimensions>
- struct check_system<homogeneous_system<L>, Dimensions> : mpl::true_ {};
- #endif
- }
- }
- }
- #if BOOST_UNITS_HAS_BOOST_TYPEOF
- #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
- BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::homogeneous_system, (class))
- #endif
- #endif
|