diff options
Diffstat (limited to 'boost/units/io.hpp')
-rw-r--r-- | boost/units/io.hpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/boost/units/io.hpp b/boost/units/io.hpp index eda835568d..c998e2739f 100644 --- a/boost/units/io.hpp +++ b/boost/units/io.hpp @@ -669,17 +669,18 @@ template<class T> struct autoprefix_norm_impl<T, true> { typedef double type; - static double call(const T& arg) { return std::abs(arg); } + static BOOST_CONSTEXPR double call(const T& arg) { return std::abs(arg); } }; template<class T> struct autoprefix_norm_impl<T, false> { typedef one type; - static one call(const T&) { return one(); } + static BOOST_CONSTEXPR one call(const T&) { return one(); } }; template<class T> +BOOST_CONSTEXPR typename autoprefix_norm_impl<T>::type autoprefix_norm(const T& arg) { return autoprefix_norm_impl<T>::call(arg); @@ -690,12 +691,14 @@ typename autoprefix_norm_impl<T>::type autoprefix_norm(const T& arg) namespace detail { template<class End, class Prev, class T, class F> +BOOST_CONSTEXPR bool find_matching_scale_impl(End, End, Prev, T, double, F) { return false; } template<class Begin, class End, class Prev, class T, class F> +BOOST_CXX14_CONSTEXPR bool find_matching_scale_impl(Begin, End end, Prev prev, T t, double x, F f) { if(Begin::item::value() > x) { @@ -714,12 +717,14 @@ bool find_matching_scale_impl(Begin, End end, Prev prev, T t, double x, F f) } template<class End, class T, class F> +BOOST_CONSTEXPR bool find_matching_scale_i(End, End, T, double, F) { return false; } template<class Begin, class End, class T, class F> +BOOST_CXX14_CONSTEXPR bool find_matching_scale_i(Begin, End end, T t, double x, F f) { if(Begin::item::value() > x) { @@ -730,6 +735,7 @@ bool find_matching_scale_i(Begin, End end, T t, double x, F f) } template<class Scales, class T, class F> +BOOST_CXX14_CONSTEXPR bool find_matching_scale(T t, double x, F f) { return detail::find_matching_scale_i(Scales(), dimensionless_type(), t, x, f); @@ -976,8 +982,8 @@ void maybe_print_prefixed(std::basic_ostream<CharT, Traits>& os, const quantity< detail::print_default(os, q)(); } -inline mpl::true_ test_norm(double) { return mpl::true_(); } -inline mpl::false_ test_norm(one) { return mpl::false_(); } +inline BOOST_CONSTEXPR mpl::true_ test_norm(double) { return mpl::true_(); } +inline BOOST_CONSTEXPR mpl::false_ test_norm(one) { return mpl::false_(); } } // namespace detail |