Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions include/tao/operators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#ifndef TAO_OPERATORS_NO_RVALUE_REFERENCE_RESULTS
#define TAO_OPERATORS_BASIC_OP( name, op ) \
template< typename T, typename U = T > \
class name /* NOLINT */ \
class TAO_OPERATORS_BROKEN_EBO name /* NOLINT */ \
{ \
friend T operator op( const T& lhs, const U& rhs ) noexcept( noexcept( T( lhs ), std::declval< T& >() op## = rhs, T( std::declval< T& >() ) ) ) \
{ \
Expand Down Expand Up @@ -65,7 +65,7 @@
#else
#define TAO_OPERATORS_BASIC_OP( name, op ) \
template< typename T, typename U = T > \
class name \
class TAO_OPERATORS_BROKEN_EBO name \
{ \
TAO_OPERATORS_NODISCARD friend T operator op( const T& lhs, const U& rhs ) noexcept( noexcept( T( lhs ), std::declval< T& >() op## = rhs, T( std::declval< T& >() ) ) ) \
{ \
Expand Down Expand Up @@ -99,7 +99,7 @@

#define TAO_OPERATORS_BASIC_OP_LEFT( name, op ) \
template< typename T, typename U > \
class name##_left \
class TAO_OPERATORS_BROKEN_EBO name##_left \
{ \
TAO_OPERATORS_NODISCARD friend T operator op( const U& lhs, const T& rhs ) noexcept( noexcept( T( lhs ), std::declval< T& >() op## = rhs, T( std::declval< T& >() ) ) ) \
{ \
Expand Down Expand Up @@ -133,7 +133,7 @@
#ifndef TAO_OPERATORS_NO_RVALUE_REFERENCE_RESULTS
#define TAO_OPERATORS_BASIC_OP_COMMUTATIVE( name, op ) \
template< typename T, typename U = T > \
class commutative_##name \
class TAO_OPERATORS_BROKEN_EBO commutative_##name \
{ \
TAO_OPERATORS_NODISCARD friend T operator op( const T& lhs, const U& rhs ) noexcept( noexcept( T( lhs ), std::declval< T& >() op## = rhs, T( std::declval< T& >() ) ) ) \
{ \
Expand Down Expand Up @@ -189,7 +189,7 @@
}; \
\
template< typename T > \
class commutative_##name< T > \
class TAO_OPERATORS_BROKEN_EBO commutative_##name< T > \
{ \
TAO_OPERATORS_NODISCARD friend T operator op( const T& lhs, const T& rhs ) noexcept( noexcept( T( lhs ), std::declval< T& >() op## = rhs, T( std::declval< T& >() ) ) ) \
{ \
Expand Down Expand Up @@ -219,7 +219,7 @@
#else
#define TAO_OPERATORS_BASIC_OP_COMMUTATIVE( name, op ) \
template< typename T, typename U = T > \
class commutative_##name \
class TAO_OPERATORS_BROKEN_EBO commutative_##name \
{ \
TAO_OPERATORS_NODISCARD friend T operator op( const T& lhs, const U& rhs ) noexcept( noexcept( T( lhs ), std::declval< T& >() op## = rhs, T( std::declval< T& >() ) ) ) \
{ \
Expand Down Expand Up @@ -279,7 +279,7 @@
}; \
\
template< typename T > \
class commutative_##name< T > \
class TAO_OPERATORS_BROKEN_EBO commutative_##name< T > \
{ \
TAO_OPERATORS_NODISCARD friend T operator op( const T& lhs, const T& rhs ) noexcept( noexcept( T( lhs ), std::declval< T& >() op## = rhs, T( std::declval< T& >() ) ) ) \
{ \
Expand Down Expand Up @@ -316,7 +316,7 @@ namespace tao
namespace operators
{
template< typename T, typename U = T >
class equality_comparable
class TAO_OPERATORS_BROKEN_EBO equality_comparable
{
TAO_OPERATORS_NODISCARD friend TAO_OPERATORS_CONSTEXPR bool operator!=( const T& lhs, const U& rhs ) noexcept( noexcept( static_cast< bool >( lhs == rhs ) ) )
{
Expand All @@ -335,7 +335,7 @@ namespace tao
};

template< typename T >
class equality_comparable< T >
class TAO_OPERATORS_BROKEN_EBO equality_comparable< T >
{
TAO_OPERATORS_NODISCARD friend TAO_OPERATORS_CONSTEXPR bool operator!=( const T& lhs, const T& rhs ) noexcept( noexcept( static_cast< bool >( lhs == rhs ) ) )
{
Expand All @@ -344,7 +344,7 @@ namespace tao
};

template< typename T, typename U = T >
class less_than_comparable
class TAO_OPERATORS_BROKEN_EBO less_than_comparable
{
TAO_OPERATORS_NODISCARD friend TAO_OPERATORS_CONSTEXPR bool operator<=( const T& lhs, const U& rhs ) noexcept( noexcept( static_cast< bool >( lhs > rhs ) ) )
{
Expand Down Expand Up @@ -378,7 +378,7 @@ namespace tao
};

template< typename T >
class less_than_comparable< T >
class TAO_OPERATORS_BROKEN_EBO less_than_comparable< T >
{
TAO_OPERATORS_NODISCARD friend TAO_OPERATORS_CONSTEXPR bool operator>( const T& lhs, const T& rhs ) noexcept( noexcept( static_cast< bool >( rhs < lhs ) ) )
{
Expand All @@ -404,7 +404,7 @@ namespace tao
};

template< typename T, typename U = T >
class equivalent
class TAO_OPERATORS_BROKEN_EBO equivalent
{
TAO_OPERATORS_NODISCARD friend TAO_OPERATORS_CONSTEXPR bool operator==( const T& lhs, const U& rhs ) noexcept( noexcept( static_cast< bool >( lhs < rhs ), static_cast< bool >( lhs > rhs ) ) )
{
Expand All @@ -413,7 +413,7 @@ namespace tao
};

template< typename T >
class equivalent< T >
class TAO_OPERATORS_BROKEN_EBO equivalent< T >
{
TAO_OPERATORS_NODISCARD friend TAO_OPERATORS_CONSTEXPR bool operator==( const T& lhs, const T& rhs ) noexcept( noexcept( static_cast< bool >( lhs < rhs ) ) )
{
Expand All @@ -422,7 +422,7 @@ namespace tao
};

template< typename T, typename U = T >
class partially_ordered
class TAO_OPERATORS_BROKEN_EBO partially_ordered
{
TAO_OPERATORS_NODISCARD friend TAO_OPERATORS_CONSTEXPR bool operator<=( const T& lhs, const U& rhs ) noexcept( noexcept( static_cast< bool >( lhs < rhs ), static_cast< bool >( lhs == rhs ) ) )
{
Expand Down Expand Up @@ -456,7 +456,7 @@ namespace tao
};

template< typename T >
class partially_ordered< T >
class TAO_OPERATORS_BROKEN_EBO partially_ordered< T >
{
TAO_OPERATORS_NODISCARD friend TAO_OPERATORS_CONSTEXPR bool operator>( const T& lhs, const T& rhs ) noexcept( noexcept( static_cast< bool >( rhs < lhs ) ) )
{
Expand Down Expand Up @@ -608,7 +608,7 @@ namespace tao
};

template< typename T >
class incrementable
class TAO_OPERATORS_BROKEN_EBO incrementable
{
TAO_OPERATORS_NODISCARD friend T operator++( T& arg, int /*unused*/ ) noexcept( noexcept( T( arg ), ++arg, T( std::declval< T >() ) ) ) // NOLINT
{
Expand All @@ -619,7 +619,7 @@ namespace tao
};

template< typename T >
class decrementable
class TAO_OPERATORS_BROKEN_EBO decrementable
{
TAO_OPERATORS_NODISCARD friend T operator--( T& arg, int /*unused*/ ) noexcept( noexcept( T( arg ), --arg, T( std::declval< T >() ) ) ) // NOLINT
{
Expand Down