forked from boostorg/variant2
Add workaround for libstdc++ < 5
This commit is contained in:
@ -359,7 +359,15 @@ template<class T1, class... T> union variant_storage_impl<mp_true, T1, T...>
|
||||
|
||||
template<std::size_t I, class... A> constexpr void emplace( mp_size_t<I>, A&&... a )
|
||||
{
|
||||
#if defined( BOOST_LIBSTDCXX_VERSION ) && BOOST_LIBSTDCXX_VERSION < 50000
|
||||
|
||||
this->emplace_impl( mp_all<std::has_trivial_move_assign<T1>, std::has_trivial_move_assign<T>...>(), mp_size_t<I>(), std::forward<A>(a)... );
|
||||
|
||||
#else
|
||||
|
||||
this->emplace_impl( mp_all<std::is_trivially_move_assignable<T1>, std::is_trivially_move_assignable<T>...>(), mp_size_t<I>(), std::forward<A>(a)... );
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
constexpr T1& get( mp_size_t<0> ) noexcept { return first_; }
|
||||
@ -495,7 +503,15 @@ template<class... T> struct variant_base_impl<true, true, T...>
|
||||
std::size_t const J = I+1;
|
||||
using U = mp_at_c<variant<T...>, I>;
|
||||
|
||||
#if defined( BOOST_LIBSTDCXX_VERSION ) && BOOST_LIBSTDCXX_VERSION < 50000
|
||||
|
||||
this->emplace_impl<J, U>( std::is_nothrow_constructible<U, A...>(), mp_all<std::has_trivial_move_constructor<U>, std::has_trivial_move_assign<T>...>(), std::forward<A>(a)... );
|
||||
|
||||
#else
|
||||
|
||||
this->emplace_impl<J, U>( std::is_nothrow_constructible<U, A...>(), mp_all<std::is_trivially_move_constructible<U>, std::is_trivially_move_assignable<T>...>(), std::forward<A>(a)... );
|
||||
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user