mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 15:04:00 +00:00
Remove constexpr from all but the comparison ops
This commit is contained in:
parent
e3a2a06011
commit
46f72656b3
@ -231,38 +231,38 @@ struct NAME##1 : B \
|
|||||||
// BOOST_OPERATOR2_LEFT(NAME) only looks cool, but doesn't provide
|
// BOOST_OPERATOR2_LEFT(NAME) only looks cool, but doesn't provide
|
||||||
// optimization opportunities to the compiler :)
|
// optimization opportunities to the compiler :)
|
||||||
|
|
||||||
#define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \
|
#define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \
|
||||||
template <class T, class U, class B = operators_detail::empty_base<T> > \
|
template <class T, class U, class B = operators_detail::empty_base<T> > \
|
||||||
struct NAME##2 : B \
|
struct NAME##2 : B \
|
||||||
{ \
|
{ \
|
||||||
friend BOOST_OPS_CONSTEXPR T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \
|
friend 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; } \
|
friend T operator OP( const U& lhs, T rhs ) { return rhs OP##= lhs; } \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
template <class T, class B = operators_detail::empty_base<T> > \
|
template <class T, class B = operators_detail::empty_base<T> > \
|
||||||
struct NAME##1 : B \
|
struct NAME##1 : B \
|
||||||
{ \
|
{ \
|
||||||
friend BOOST_OPS_CONSTEXPR T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
|
friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \
|
#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \
|
||||||
template <class T, class U, class B = operators_detail::empty_base<T> > \
|
template <class T, class U, class B = operators_detail::empty_base<T> > \
|
||||||
struct NAME##2 : B \
|
struct NAME##2 : B \
|
||||||
{ \
|
{ \
|
||||||
friend BOOST_OPS_CONSTEXPR T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \
|
friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
template <class T, class U, class B = operators_detail::empty_base<T> > \
|
template <class T, class U, class B = operators_detail::empty_base<T> > \
|
||||||
struct BOOST_OPERATOR2_LEFT(NAME) : B \
|
struct BOOST_OPERATOR2_LEFT(NAME) : B \
|
||||||
{ \
|
{ \
|
||||||
friend BOOST_OPS_CONSTEXPR T operator OP( const U& lhs, const T& rhs ) \
|
friend T operator OP( const U& lhs, const T& rhs ) \
|
||||||
{ return T( lhs ) OP##= rhs; } \
|
{ return T( lhs ) OP##= rhs; } \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
template <class T, class B = operators_detail::empty_base<T> > \
|
template <class T, class B = operators_detail::empty_base<T> > \
|
||||||
struct NAME##1 : B \
|
struct NAME##1 : B \
|
||||||
{ \
|
{ \
|
||||||
friend BOOST_OPS_CONSTEXPR T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
|
friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
|
#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)
|
#else // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
|
||||||
|
|
||||||
#define BOOST_BINARY_OPERATOR( NAME, OP ) \
|
#define BOOST_BINARY_OPERATOR( NAME, OP ) \
|
||||||
template <class T, class U, class B = operators_detail::empty_base<T> > \
|
template <class T, class U, class B = operators_detail::empty_base<T> > \
|
||||||
struct NAME##2 : B \
|
struct NAME##2 : B \
|
||||||
{ \
|
{ \
|
||||||
friend BOOST_OPS_CONSTEXPR T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \
|
friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
template <class T, class B = operators_detail::empty_base<T> > \
|
template <class T, class B = operators_detail::empty_base<T> > \
|
||||||
struct NAME##1 : B \
|
struct NAME##1 : B \
|
||||||
{ \
|
{ \
|
||||||
friend BOOST_OPS_CONSTEXPR T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
|
friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
|
#endif // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user