123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- #ifndef BOOST_UNITS_BASE_DIMENSION_HPP
- #define BOOST_UNITS_BASE_DIMENSION_HPP
- #include <boost/units/config.hpp>
- #include <boost/units/dim.hpp>
- #include <boost/units/static_rational.hpp>
- #include <boost/units/units_fwd.hpp>
- #include <boost/units/detail/dimension_list.hpp>
- #include <boost/units/detail/ordinal.hpp>
- #include <boost/units/detail/prevent_redefinition.hpp>
- namespace boost {
- namespace units {
- template<long N> struct base_dimension_ordinal { };
- template<class T, long N> struct base_dimension_pair { };
- template<class T, long N>
- struct check_base_dimension {
- enum {
- value =
- sizeof(boost_units_is_registered(units::base_dimension_ordinal<N>())) == sizeof(detail::yes) &&
- sizeof(boost_units_is_registered(units::base_dimension_pair<T, N>())) != sizeof(detail::yes)
- };
- };
- template<class Derived,
- long N
- #if !defined(BOOST_UNITS_DOXYGEN) && !defined(BOOST_BORLANDC)
- ,
- class = typename detail::ordinal_has_already_been_defined<
- check_base_dimension<Derived, N>::value
- >::type
- #endif
- >
- class base_dimension :
- public ordinal<N>
- {
- public:
-
- typedef base_dimension this_type;
-
- #ifndef BOOST_UNITS_DOXYGEN
- typedef list<dim<Derived,static_rational<1> >, dimensionless_type> dimension_type;
- #else
- typedef detail::unspecified dimension_type;
- #endif
-
- typedef Derived type;
- private:
-
-
-
-
-
-
- friend BOOST_CONSTEXPR Derived*
- check_double_register(const units::base_dimension_ordinal<N>&)
- { return(0); }
-
-
- friend BOOST_CONSTEXPR detail::yes
- boost_units_is_registered(const units::base_dimension_ordinal<N>&)
- { return(detail::yes()); }
-
-
-
- friend BOOST_CONSTEXPR detail::yes
- boost_units_is_registered(const units::base_dimension_pair<Derived, N>&)
- { return(detail::yes()); }
- };
- }
- }
- #endif
|