From 46f72656b3d65fe3d7ca21d4b4e483e1f8918d94 Mon Sep 17 00:00:00 2001 From: Tony Lewis Date: Sat, 11 Apr 2020 18:31:15 +0100 Subject: [PATCH] Remove constexpr from all but the comparison ops --- include/boost/operators.hpp | 82 ++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/include/boost/operators.hpp b/include/boost/operators.hpp index 6334ed9..aca5ea8 100644 --- a/include/boost/operators.hpp +++ b/include/boost/operators.hpp @@ -231,38 +231,38 @@ struct NAME##1 : B \ // BOOST_OPERATOR2_LEFT(NAME) only looks cool, but doesn't provide // optimization opportunities to the compiler :) -#define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \ -template > \ -struct NAME##2 : B \ -{ \ - friend BOOST_OPS_CONSTEXPR T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \ - friend BOOST_OPS_CONSTEXPR T operator OP( const U& lhs, T rhs ) { return rhs OP##= lhs; } \ -}; \ - \ -template > \ -struct NAME##1 : B \ -{ \ - friend BOOST_OPS_CONSTEXPR T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \ +#define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \ +template > \ +struct NAME##2 : B \ +{ \ + friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \ + friend T operator OP( const U& lhs, T rhs ) { return rhs OP##= lhs; } \ +}; \ + \ +template > \ +struct NAME##1 : B \ +{ \ + friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \ }; -#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \ -template > \ -struct NAME##2 : B \ -{ \ - friend BOOST_OPS_CONSTEXPR T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \ -}; \ - \ -template > \ -struct BOOST_OPERATOR2_LEFT(NAME) : B \ -{ \ - friend BOOST_OPS_CONSTEXPR T operator OP( const U& lhs, const T& rhs ) \ - { return T( lhs ) OP##= rhs; } \ -}; \ - \ -template > \ -struct NAME##1 : B \ -{ \ - friend BOOST_OPS_CONSTEXPR T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \ +#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \ +template > \ +struct NAME##2 : B \ +{ \ + friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \ +}; \ + \ +template > \ +struct BOOST_OPERATOR2_LEFT(NAME) : B \ +{ \ + friend T operator OP( const U& lhs, const T& rhs ) \ + { return T( lhs ) OP##= rhs; } \ +}; \ + \ +template > \ +struct NAME##1 : B \ +{ \ + friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \ }; #endif // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS) @@ -350,17 +350,17 @@ struct NAME##1 : B \ #else // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS) -#define BOOST_BINARY_OPERATOR( NAME, OP ) \ -template > \ -struct NAME##2 : B \ -{ \ - friend BOOST_OPS_CONSTEXPR T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \ -}; \ - \ -template > \ -struct NAME##1 : B \ -{ \ - friend BOOST_OPS_CONSTEXPR T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \ +#define BOOST_BINARY_OPERATOR( NAME, OP ) \ +template > \ +struct NAME##2 : B \ +{ \ + friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \ +}; \ + \ +template > \ +struct NAME##1 : B \ +{ \ + friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \ }; #endif // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)