diff options
Diffstat (limited to 'boost/algorithm/algorithm.hpp')
-rw-r--r-- | boost/algorithm/algorithm.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/boost/algorithm/algorithm.hpp b/boost/algorithm/algorithm.hpp index ab0d4aff58..2bbee1d2d4 100644 --- a/boost/algorithm/algorithm.hpp +++ b/boost/algorithm/algorithm.hpp @@ -25,10 +25,10 @@ namespace boost { namespace algorithm { template <typename T> -T identity_operation ( std::multiplies<T> ) { return T(1); } +BOOST_CXX14_CONSTEXPR T identity_operation ( std::multiplies<T> ) { return T(1); } template <typename T> -T identity_operation ( std::plus<T> ) { return T(0); } +BOOST_CXX14_CONSTEXPR T identity_operation ( std::plus<T> ) { return T(0); } /// \fn power ( T x, Integer n ) @@ -40,7 +40,7 @@ T identity_operation ( std::plus<T> ) { return T(0); } // \remark Taken from Knuth, The Art of Computer Programming, Volume 2: // Seminumerical Algorithms, Section 4.6.3 template <typename T, typename Integer> -typename boost::enable_if<boost::is_integral<Integer>, T>::type +BOOST_CXX14_CONSTEXPR typename boost::enable_if<boost::is_integral<Integer>, T>::type power (T x, Integer n) { T y = 1; // Should be "T y{1};" if (n == 0) return y; @@ -67,7 +67,7 @@ power (T x, Integer n) { // \remark Taken from Knuth, The Art of Computer Programming, Volume 2: // Seminumerical Algorithms, Section 4.6.3 template <typename T, typename Integer, typename Operation> -typename boost::enable_if<boost::is_integral<Integer>, T>::type +BOOST_CXX14_CONSTEXPR typename boost::enable_if<boost::is_integral<Integer>, T>::type power (T x, Integer n, Operation op) { T y = identity_operation(op); if (n == 0) return y; |