#ifndef MCS_DIMENSION_TAG_HPP #define MCS_DIMENSION_TAG_HPP #include #include #include namespace mcs { namespace units { // represents single dimension exponent; e.g. dim_type -> length_tag // value_type -> Rational<4,3> template struct dim { typedef T dim_type; typedef V value_type; }; // dim concept check template struct is_dim { typedef boost::mpl::false_ type; static const bool value = false; }; template struct is_dim< dim > { typedef boost::mpl::true_ type; static const bool value = true; }; // extract dim type template struct get_dim { typedef typename T::dim_type type; }; // extract dim value template struct get_value { typedef typename T::value_type type; }; // negate a dimension template struct Negate< dim > { typedef dim::type> type; }; template struct Add< dim,dim > { typedef dim::type> type; }; template struct Subtract< dim,dim > { typedef dim::type> type; }; template struct Multiply< dim,Rational > { typedef dim >::type> type; }; template struct Divide< dim,Rational > { typedef dim >::type> type; }; } // namespace units } // namespace mcs #endif // MCS_DIMENSION_TAG_HPP