diff options
Diffstat (limited to 'boost/units/detail/unscale.hpp')
-rw-r--r-- | boost/units/detail/unscale.hpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/boost/units/detail/unscale.hpp b/boost/units/detail/unscale.hpp index 08e51e96d5..e221756b11 100644 --- a/boost/units/detail/unscale.hpp +++ b/boost/units/detail/unscale.hpp @@ -143,7 +143,7 @@ struct eval_scale_list_impl { typedef typename eval_scale_list_impl<N-1>::template apply<typename Begin::next> next_iteration; typedef typename multiply_typeof_helper<typename next_iteration::type, typename Begin::item::value_type>::type type; - static type value() + static BOOST_CONSTEXPR type value() { return(next_iteration::value() * Begin::item::value()); } @@ -157,10 +157,9 @@ struct eval_scale_list_impl<0> struct apply { typedef one type; - static one value() + static BOOST_CONSTEXPR one value() { - one result; - return(result); + return(one()); } }; }; @@ -225,6 +224,22 @@ struct times_impl<boost::units::scale_dim_tag, boost::units::detail::static_rati }; }; +/// INTERNAL ONLY +template<> +struct divides_impl<boost::units::scale_dim_tag, boost::units::detail::static_rational_tag> +{ + template<class T0, class T1> + struct apply + { + typedef boost::units::scale_list_dim< + boost::units::scale< + (T0::base), + typename mpl::divides<typename T0::exponent, T1>::type + > + > type; + }; +}; + } // namespace mpl #endif |