Completely remove constexpr for MSVC

This commit is contained in:
Tony Lewis
2018-12-24 07:02:31 +00:00
parent 91ebdcd1dd
commit 6b62dcc504
3 changed files with 87 additions and 70 deletions

View File

@@ -50,9 +50,9 @@ namespace
void operator!() const;
public:
BOOST_CONSTEXPR convertible_to_bool( const bool value ) : _value( value ) {}
BOOST_OPS_CONSTEXPR convertible_to_bool( const bool value ) : _value( value ) {}
BOOST_CONSTEXPR operator unspecified_bool_type() const
BOOST_OPS_CONSTEXPR operator unspecified_bool_type() const
{ return _value ? &convertible_to_bool::_value : 0; }
};
@@ -64,12 +64,12 @@ namespace
, boost::shiftable<Wrapped1<T> >
{
public:
BOOST_CONSTEXPR explicit Wrapped1( T v = T() ) : _value(v) {}
BOOST_CONSTEXPR T value() const { return _value; }
BOOST_OPS_CONSTEXPR explicit Wrapped1( T v = T() ) : _value(v) {}
BOOST_OPS_CONSTEXPR T value() const { return _value; }
BOOST_CONSTEXPR convertible_to_bool operator<(const Wrapped1& x) const
BOOST_OPS_CONSTEXPR convertible_to_bool operator<(const Wrapped1& x) const
{ return _value < x._value; }
BOOST_CONSTEXPR convertible_to_bool operator==(const Wrapped1& x) const
BOOST_OPS_CONSTEXPR convertible_to_bool operator==(const Wrapped1& x) const
{ return _value == x._value; }
Wrapped1& operator+=(const Wrapped1& x)
@@ -934,6 +934,7 @@ main()
// Where C++11 constexpr is available, compile-time test some of the operators that are able to use it to propagate constexpr
#ifndef BOOST_NO_CXX11_CONSTEXPR
#ifndef BOOST_MSVC
static_assert( ! static_cast<bool>( MyInt{ 1 } == MyInt{ 2 } ), "" );
static_assert( MyInt{ 1 } != MyInt{ 2 }, "" );
static_assert( MyInt{ 1 } < MyInt{ 2 }, "" );
@@ -954,6 +955,7 @@ main()
static_assert( MyInt{ 1 } <= MyInt{ 1 }, "" );
static_assert( ! static_cast<bool>( MyInt{ 1 } > MyInt{ 1 } ), "" );
static_assert( MyInt{ 1 } >= MyInt{ 1 }, "" );
#endif
#endif
return boost::report_errors();