mirror of
https://github.com/boostorg/utility.git
synced 2025-10-16 02:25:18 +02:00
Remove C++14 constexpr due to MSVC/GCC problems
This commit is contained in:
@@ -72,28 +72,28 @@ namespace
|
||||
BOOST_CONSTEXPR convertible_to_bool operator==(const Wrapped1& x) const
|
||||
{ return _value == x._value; }
|
||||
|
||||
BOOST_CXX14_CONSTEXPR Wrapped1& operator+=(const Wrapped1& x)
|
||||
Wrapped1& operator+=(const Wrapped1& x)
|
||||
{ _value += x._value; return *this; }
|
||||
BOOST_CXX14_CONSTEXPR Wrapped1& operator-=(const Wrapped1& x)
|
||||
Wrapped1& operator-=(const Wrapped1& x)
|
||||
{ _value -= x._value; return *this; }
|
||||
BOOST_CXX14_CONSTEXPR Wrapped1& operator*=(const Wrapped1& x)
|
||||
Wrapped1& operator*=(const Wrapped1& x)
|
||||
{ _value *= x._value; return *this; }
|
||||
BOOST_CXX14_CONSTEXPR Wrapped1& operator/=(const Wrapped1& x)
|
||||
Wrapped1& operator/=(const Wrapped1& x)
|
||||
{ _value /= x._value; return *this; }
|
||||
BOOST_CXX14_CONSTEXPR Wrapped1& operator%=(const Wrapped1& x)
|
||||
Wrapped1& operator%=(const Wrapped1& x)
|
||||
{ _value %= x._value; return *this; }
|
||||
BOOST_CXX14_CONSTEXPR Wrapped1& operator|=(const Wrapped1& x)
|
||||
Wrapped1& operator|=(const Wrapped1& x)
|
||||
{ _value |= x._value; return *this; }
|
||||
BOOST_CXX14_CONSTEXPR Wrapped1& operator&=(const Wrapped1& x)
|
||||
Wrapped1& operator&=(const Wrapped1& x)
|
||||
{ _value &= x._value; return *this; }
|
||||
BOOST_CXX14_CONSTEXPR Wrapped1& operator^=(const Wrapped1& x)
|
||||
Wrapped1& operator^=(const Wrapped1& x)
|
||||
{ _value ^= x._value; return *this; }
|
||||
BOOST_CXX14_CONSTEXPR Wrapped1& operator<<=(const Wrapped1& x)
|
||||
Wrapped1& operator<<=(const Wrapped1& x)
|
||||
{ _value <<= x._value; return *this; }
|
||||
BOOST_CXX14_CONSTEXPR Wrapped1& operator>>=(const Wrapped1& x)
|
||||
Wrapped1& operator>>=(const Wrapped1& x)
|
||||
{ _value >>= x._value; return *this; }
|
||||
BOOST_CXX14_CONSTEXPR Wrapped1& operator++() { ++_value; return *this; }
|
||||
BOOST_CXX14_CONSTEXPR Wrapped1& operator--() { --_value; return *this; }
|
||||
Wrapped1& operator++() { ++_value; return *this; }
|
||||
Wrapped1& operator--() { --_value; return *this; }
|
||||
|
||||
private:
|
||||
T _value;
|
||||
@@ -956,40 +956,5 @@ main()
|
||||
static_assert( MyInt{ 1 } >= MyInt{ 1 }, "" );
|
||||
#endif
|
||||
|
||||
// Where C++14 constexpr is available, compile-time test some of the operators that are able to use it to propagate constexpr
|
||||
#ifndef BOOST_NO_CXX14_CONSTEXPR
|
||||
static_assert( ( MyInt{ 1 } + MyInt{ 2 } ) == MyInt{ 3 }, "" );
|
||||
static_assert( ( MyInt{ 2 } + MyInt{ 1 } ) == MyInt{ 3 }, "" );
|
||||
static_assert( ( MyInt{ 2 } + MyInt{ 1 } ) == MyInt{ 3 }, "" );
|
||||
static_assert( ( MyInt{ 2 } + MyInt{ 2 } ) == MyInt{ 4 }, "" );
|
||||
static_assert( ( MyInt{ 3 } + MyInt{ 2 } ) == MyInt{ 5 }, "" );
|
||||
|
||||
static_assert( ( MyInt{ 5 } - MyInt{ 1 } ) == MyInt{ 4 }, "" );
|
||||
|
||||
static_assert( ( MyInt{ 3 } * MyInt{ 3 } ) == MyInt{ 9 }, "" );
|
||||
static_assert( ( MyInt{ 4 } * MyInt{ 2 } ) == MyInt{ 8 }, "" );
|
||||
|
||||
static_assert( ( MyInt{ 8 } / MyInt{ 2 } ) == MyInt{ 4 }, "" );
|
||||
|
||||
static_assert( ( MyInt{ 4 } % MyInt{ 3 } ) == MyInt{ 1 }, "" );
|
||||
|
||||
|
||||
static_assert( ( MyInt{ 7 } & MyInt{ 2 } ) == MyInt{ 2 }, "" );
|
||||
|
||||
static_assert( ( MyInt{ 1 } | MyInt{ 2 } ) == MyInt{ 3 }, "" );
|
||||
static_assert( ( MyInt{ 1 } | MyInt{ 4 } ) == MyInt{ 5 }, "" );
|
||||
static_assert( ( MyInt{ 2 } | MyInt{ 1 } ) == MyInt{ 3 }, "" );
|
||||
static_assert( ( MyInt{ 2 } | MyInt{ 4 } ) == MyInt{ 6 }, "" );
|
||||
static_assert( ( MyInt{ 3 } | MyInt{ 4 } ) == MyInt{ 7 }, "" );
|
||||
static_assert( ( MyInt{ 5 } | MyInt{ 2 } ) == MyInt{ 7 }, "" );
|
||||
static_assert( ( MyInt{ 6 } | MyInt{ 1 } ) == MyInt{ 7 }, "" );
|
||||
|
||||
static_assert( ( MyInt{ 3 } ^ MyInt{ 1 } ) == MyInt{ 2 }, "" );
|
||||
|
||||
|
||||
static_assert( ( MyInt{ 1 } << MyInt{ 2 } ) == MyInt{ 4 }, "" );
|
||||
static_assert( ( MyInt{ 2 } >> MyInt{ 1 } ) == MyInt{ 1 }, "" );
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
Reference in New Issue
Block a user