|
From: Steven W. <ste...@us...> - 2007-04-04 23:42:25
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv623/boost-sandbox/boost/units Modified Files: dimension.hpp Log Message: Added mpl arithmetic Index: dimension.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/dimension.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- dimension.hpp 4 Apr 2007 20:07:36 -0000 1.2 +++ dimension.hpp 4 Apr 2007 23:42:25 -0000 1.3 @@ -13,6 +13,7 @@ #include <boost/static_assert.hpp> +#include <boost/mpl/arithmetic.hpp> #include <boost/mpl/and.hpp> #include <boost/mpl/begin_end.hpp> #include <boost/mpl/bool_fwd.hpp> @@ -202,6 +203,60 @@ } // namespace units +namespace mpl { + +template<> +struct plus_impl<boost::units::detail::dimension_list_tag,boost::units::detail::dimension_list_tag> +{ + template<class T0, class T1> + struct apply + { + typedef typename boost::units::static_add<T0, T1>::type type; + }; +}; + +template<> +struct minus_impl<boost::units::detail::dimension_list_tag,boost::units::detail::dimension_list_tag> +{ + template<class T0, class T1> + struct apply + { + typedef typename boost::units::static_subtract<T0, T1>::type type; + }; +}; + +template<> +struct times_impl<boost::units::detail::dimension_list_tag,boost::units::detail::dimension_list_tag> +{ + template<class T0, class T1> + struct apply + { + typedef typename boost::units::static_multiply<T0, T1>::type type; + }; +}; + +template<> +struct divides_impl<boost::units::detail::dimension_list_tag,boost::units::detail::dimension_list_tag> +{ + template<class T0, class T1> + struct apply + { + typedef typename boost::units::static_divide<T0, T1>::type type; + }; +}; + +template<> +struct negate_impl<boost::units::detail::dimension_list_tag> +{ + template<class T0, class T1> + struct apply + { + typedef typename boost::units::static_negate<T0>::type type; + }; +}; + +} // namespace mpl + } // namespace boost #endif // BOOST_UNITS_DIMENSION_HPP |