Warning, file /include/boost/units/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 #ifndef BOOST_UNITS_DIMENSION_HPP
0012 #define BOOST_UNITS_DIMENSION_HPP
0013
0014 #include <boost/static_assert.hpp>
0015
0016 #include <boost/type_traits/is_same.hpp>
0017
0018 #include <boost/mpl/arithmetic.hpp>
0019
0020 #include <boost/units/static_rational.hpp>
0021 #include <boost/units/detail/dimension_list.hpp>
0022 #include <boost/units/detail/dimension_impl.hpp>
0023
0024
0025
0026
0027 namespace boost {
0028
0029 namespace units {
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053 template<typename Seq>
0054 struct make_dimension_list
0055 {
0056 typedef typename detail::sort_dims<Seq>::type type;
0057 };
0058
0059
0060 template<typename DL,typename Ex>
0061 struct static_power
0062 {
0063 typedef typename detail::static_power_impl<DL::size::value>::template apply<
0064 DL,
0065 Ex
0066 >::type type;
0067 };
0068
0069
0070 template<typename DL,typename Rt>
0071 struct static_root
0072 {
0073 typedef typename detail::static_root_impl<DL::size::value>::template apply<
0074 DL,
0075 Rt
0076 >::type type;
0077 };
0078
0079 }
0080
0081 #ifndef BOOST_UNITS_DOXYGEN
0082
0083 namespace mpl {
0084
0085 template<>
0086 struct plus_impl<boost::units::detail::dimension_list_tag,boost::units::detail::dimension_list_tag>
0087 {
0088 template<class T0, class T1>
0089 struct apply
0090 {
0091 BOOST_STATIC_ASSERT((boost::is_same<T0,T1>::value == true));
0092 typedef T0 type;
0093 };
0094 };
0095
0096 template<>
0097 struct minus_impl<boost::units::detail::dimension_list_tag,boost::units::detail::dimension_list_tag>
0098 {
0099 template<class T0, class T1>
0100 struct apply
0101 {
0102 BOOST_STATIC_ASSERT((boost::is_same<T0,T1>::value == true));
0103 typedef T0 type;
0104 };
0105 };
0106
0107 template<>
0108 struct times_impl<boost::units::detail::dimension_list_tag,boost::units::detail::dimension_list_tag>
0109 {
0110 template<class T0, class T1>
0111 struct apply
0112 {
0113 typedef typename boost::units::detail::merge_dimensions<T0,T1>::type type;
0114 };
0115 };
0116
0117 template<>
0118 struct divides_impl<boost::units::detail::dimension_list_tag,boost::units::detail::dimension_list_tag>
0119 {
0120 template<class T0, class T1>
0121 struct apply
0122 {
0123 typedef typename boost::units::detail::merge_dimensions<
0124 T0,
0125 typename boost::units::detail::static_inverse_impl<
0126 T1::size::value
0127 >::template apply<
0128 T1
0129 >::type
0130 >::type type;
0131 };
0132 };
0133
0134 template<>
0135 struct negate_impl<boost::units::detail::dimension_list_tag>
0136 {
0137 template<class T0>
0138 struct apply
0139 {
0140 typedef T0 type;
0141 };
0142 };
0143
0144 }
0145
0146 #endif
0147
0148 }
0149
0150 #endif