Warning, file /include/boost/units/base_dimension.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
0012
0013
0014
0015 #ifndef BOOST_UNITS_BASE_DIMENSION_HPP
0016 #define BOOST_UNITS_BASE_DIMENSION_HPP
0017
0018 #include <boost/units/config.hpp>
0019 #include <boost/units/dim.hpp>
0020 #include <boost/units/static_rational.hpp>
0021 #include <boost/units/units_fwd.hpp>
0022 #include <boost/units/detail/dimension_list.hpp>
0023 #include <boost/units/detail/ordinal.hpp>
0024 #include <boost/units/detail/prevent_redefinition.hpp>
0025
0026 namespace boost {
0027
0028 namespace units {
0029
0030
0031
0032
0033 template<long N> struct base_dimension_ordinal { };
0034
0035
0036 template<class T, long N> struct base_dimension_pair { };
0037
0038
0039 template<class T, long N>
0040 struct check_base_dimension {
0041 enum {
0042 value =
0043 sizeof(boost_units_is_registered(units::base_dimension_ordinal<N>())) == sizeof(detail::yes) &&
0044 sizeof(boost_units_is_registered(units::base_dimension_pair<T, N>())) != sizeof(detail::yes)
0045 };
0046 };
0047
0048
0049
0050
0051
0052
0053
0054
0055 template<class Derived,
0056 long N
0057 #if !defined(BOOST_UNITS_DOXYGEN) && !defined(BOOST_BORLANDC)
0058 ,
0059 class = typename detail::ordinal_has_already_been_defined<
0060 check_base_dimension<Derived, N>::value
0061 >::type
0062 #endif
0063 >
0064 class base_dimension :
0065 public ordinal<N>
0066 {
0067 public:
0068
0069 typedef base_dimension this_type;
0070
0071 #ifndef BOOST_UNITS_DOXYGEN
0072 typedef list<dim<Derived,static_rational<1> >, dimensionless_type> dimension_type;
0073 #else
0074 typedef detail::unspecified dimension_type;
0075 #endif
0076
0077 typedef Derived type;
0078
0079 private:
0080
0081
0082
0083
0084
0085
0086 friend BOOST_CONSTEXPR Derived*
0087 check_double_register(const units::base_dimension_ordinal<N>&)
0088 { return(0); }
0089
0090
0091
0092 friend BOOST_CONSTEXPR detail::yes
0093 boost_units_is_registered(const units::base_dimension_ordinal<N>&)
0094 { return(detail::yes()); }
0095
0096
0097
0098 friend BOOST_CONSTEXPR detail::yes
0099 boost_units_is_registered(const units::base_dimension_pair<Derived, N>&)
0100 { return(detail::yes()); }
0101 };
0102
0103 }
0104
0105 }
0106
0107 #endif