forked from boostorg/variant2
Only assert when C++14
This commit is contained in:
@ -371,8 +371,12 @@ template<std::size_t I, class... T> constexpr variant_alternative_t<I, variant<T
|
|||||||
{
|
{
|
||||||
static_assert( I < sizeof...(T), "Index out of bounds" );
|
static_assert( I < sizeof...(T), "Index out of bounds" );
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX14_CONSTEXPR)
|
||||||
|
|
||||||
BOOST_ASSERT( v.index() == I );
|
BOOST_ASSERT( v.index() == I );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
return v._get_impl( mp11::mp_size_t<I>() );
|
return v._get_impl( mp11::mp_size_t<I>() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -380,8 +384,12 @@ template<std::size_t I, class... T> constexpr variant_alternative_t<I, variant<T
|
|||||||
{
|
{
|
||||||
static_assert( I < sizeof...(T), "Index out of bounds" );
|
static_assert( I < sizeof...(T), "Index out of bounds" );
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX14_CONSTEXPR)
|
||||||
|
|
||||||
BOOST_ASSERT( v.index() == I );
|
BOOST_ASSERT( v.index() == I );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
return std::move( v._get_impl( mp11::mp_size_t<I>() ) );
|
return std::move( v._get_impl( mp11::mp_size_t<I>() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,8 +397,12 @@ template<std::size_t I, class... T> constexpr variant_alternative_t<I, variant<T
|
|||||||
{
|
{
|
||||||
static_assert( I < sizeof...(T), "Index out of bounds" );
|
static_assert( I < sizeof...(T), "Index out of bounds" );
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX14_CONSTEXPR)
|
||||||
|
|
||||||
BOOST_ASSERT( v.index() == I );
|
BOOST_ASSERT( v.index() == I );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
return v._get_impl( mp11::mp_size_t<I>() );
|
return v._get_impl( mp11::mp_size_t<I>() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -398,8 +410,12 @@ template<std::size_t I, class... T> constexpr variant_alternative_t<I, variant<T
|
|||||||
{
|
{
|
||||||
static_assert( I < sizeof...(T), "Index out of bounds" );
|
static_assert( I < sizeof...(T), "Index out of bounds" );
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX14_CONSTEXPR)
|
||||||
|
|
||||||
BOOST_ASSERT( v.index() == I );
|
BOOST_ASSERT( v.index() == I );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
return std::move( v._get_impl( mp11::mp_size_t<I>() ) );
|
return std::move( v._get_impl( mp11::mp_size_t<I>() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user