mirror of
https://github.com/boostorg/variant2.git
synced 2025-07-30 12:17:16 +02:00
Apply msvc-14.0 workarounds
This commit is contained in:
@ -1257,9 +1257,27 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !BOOST_WORKAROUND( BOOST_MSVC, < 1910 )
|
||||||
|
|
||||||
variant( variant const& ) = default;
|
variant( variant const& ) = default;
|
||||||
variant( variant && ) = default;
|
variant( variant && ) = default;
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
variant( variant const volatile& ) = delete;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
template<class E = std::enable_if< std::is_copy_constructible<variant_base>::value >::type>
|
||||||
|
constexpr variant( variant const& r ) noexcept( std::is_nothrow_copy_constructible<variant_base>::value ): variant_base( static_cast<variant_base const&>( r ) ) {}
|
||||||
|
|
||||||
|
template<class E = std::enable_if< std::is_move_constructible<variant_base>::value >::type>
|
||||||
|
constexpr variant( variant && r ) noexcept( std::is_nothrow_move_constructible<variant_base>::value ): variant_base( static_cast<variant_base &&>( r ) ) {}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
template<class U,
|
template<class U,
|
||||||
class Ud = typename std::decay<U>::type,
|
class Ud = typename std::decay<U>::type,
|
||||||
class E1 = typename std::enable_if< !std::is_same<Ud, variant>::value && !detail::is_in_place_index<Ud>::value && !detail::is_in_place_type<Ud>::value >::type,
|
class E1 = typename std::enable_if< !std::is_same<Ud, variant>::value && !detail::is_in_place_index<Ud>::value && !detail::is_in_place_type<Ud>::value >::type,
|
||||||
@ -1294,9 +1312,35 @@ public:
|
|||||||
|
|
||||||
// assignment
|
// assignment
|
||||||
|
|
||||||
|
#if !BOOST_WORKAROUND( BOOST_MSVC, < 1910 )
|
||||||
|
|
||||||
variant& operator=( variant const& ) = default;
|
variant& operator=( variant const& ) = default;
|
||||||
variant& operator=( variant && ) = default;
|
variant& operator=( variant && ) = default;
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
variant& operator=( variant const volatile& ) = delete;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
template<class E = std::enable_if< std::is_copy_assignable<variant_base>::value >::type>
|
||||||
|
variant& operator=( variant const& r ) noexcept( std::is_nothrow_copy_assignable<variant_base>::value )
|
||||||
|
{
|
||||||
|
static_cast< variant_base& >( *this ) = static_cast< variant_base const& >( r );
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class E = std::enable_if< std::is_move_assignable<variant_base>::value >::type>
|
||||||
|
variant& operator=( variant && r ) noexcept( std::is_nothrow_move_assignable<variant_base>::value )
|
||||||
|
{
|
||||||
|
static_cast< variant_base& >( *this ) = static_cast< variant_base && >( r );
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
template<class U,
|
template<class U,
|
||||||
class E1 = typename std::enable_if<!std::is_same<typename std::decay<U>::type, variant>::value>::type,
|
class E1 = typename std::enable_if<!std::is_same<typename std::decay<U>::type, variant>::value>::type,
|
||||||
class V = detail::resolve_overload_type<U, T...>,
|
class V = detail::resolve_overload_type<U, T...>,
|
||||||
|
18
test/Jamfile
18
test/Jamfile
@ -29,16 +29,16 @@ run variant_size.cpp ;
|
|||||||
run variant_alternative.cpp ;
|
run variant_alternative.cpp ;
|
||||||
|
|
||||||
run variant_holds_alternative.cpp ;
|
run variant_holds_alternative.cpp ;
|
||||||
compile variant_holds_alternative_cx.cpp ;
|
compile variant_holds_alternative_cx.cpp : <toolset>msvc-14.0:<build>no ;
|
||||||
|
|
||||||
run variant_get_by_index.cpp ;
|
run variant_get_by_index.cpp ;
|
||||||
compile variant_get_by_index_cx.cpp ;
|
compile variant_get_by_index_cx.cpp : <toolset>msvc-14.0:<build>no ;
|
||||||
|
|
||||||
run variant_get_by_type.cpp ;
|
run variant_get_by_type.cpp ;
|
||||||
compile variant_get_by_type_cx.cpp ;
|
compile variant_get_by_type_cx.cpp : <toolset>msvc-14.0:<build>no ;
|
||||||
|
|
||||||
run variant_default_construct.cpp ;
|
run variant_default_construct.cpp ;
|
||||||
compile variant_default_construct_cx.cpp ;
|
compile variant_default_construct_cx.cpp : <toolset>msvc-14.0:<build>no ;
|
||||||
|
|
||||||
run variant_copy_construct.cpp ;
|
run variant_copy_construct.cpp ;
|
||||||
compile variant_copy_construct_cx.cpp : <toolset>msvc-14.0:<build>no ;
|
compile variant_copy_construct_cx.cpp : <toolset>msvc-14.0:<build>no ;
|
||||||
@ -47,13 +47,13 @@ run variant_move_construct.cpp ;
|
|||||||
compile variant_move_construct_cx.cpp : [ requires cxx14_constexpr ] ;
|
compile variant_move_construct_cx.cpp : [ requires cxx14_constexpr ] ;
|
||||||
|
|
||||||
run variant_value_construct.cpp ;
|
run variant_value_construct.cpp ;
|
||||||
compile variant_value_construct_cx.cpp ;
|
compile variant_value_construct_cx.cpp : <toolset>msvc-14.0:<build>no ;
|
||||||
|
|
||||||
run variant_in_place_index_construct.cpp ;
|
run variant_in_place_index_construct.cpp ;
|
||||||
compile variant_in_place_index_construct_cx.cpp ;
|
compile variant_in_place_index_construct_cx.cpp : <toolset>msvc-14.0:<build>no ;
|
||||||
|
|
||||||
run variant_in_place_type_construct.cpp ;
|
run variant_in_place_type_construct.cpp ;
|
||||||
compile variant_in_place_type_construct_cx.cpp ;
|
compile variant_in_place_type_construct_cx.cpp : <toolset>msvc-14.0:<build>no ;
|
||||||
|
|
||||||
run variant_copy_assign.cpp ;
|
run variant_copy_assign.cpp ;
|
||||||
compile variant_copy_assign_cx.cpp : [ requires cxx14_constexpr ] ;
|
compile variant_copy_assign_cx.cpp : [ requires cxx14_constexpr ] ;
|
||||||
@ -99,10 +99,10 @@ local NX =
|
|||||||
;
|
;
|
||||||
|
|
||||||
run variant_get_by_index.cpp throw_exception.cpp : : : $(NX) : variant_get_by_index_nx ;
|
run variant_get_by_index.cpp throw_exception.cpp : : : $(NX) : variant_get_by_index_nx ;
|
||||||
compile variant_get_by_index_cx.cpp : $(NX) : variant_get_by_index_cx_nx ;
|
compile variant_get_by_index_cx.cpp : $(NX) <toolset>msvc-14.0:<build>no : variant_get_by_index_cx_nx ;
|
||||||
|
|
||||||
run variant_get_by_type.cpp throw_exception.cpp : : : $(NX) : variant_get_by_type_nx ;
|
run variant_get_by_type.cpp throw_exception.cpp : : : $(NX) : variant_get_by_type_nx ;
|
||||||
compile variant_get_by_type_cx.cpp : $(NX) : variant_get_by_type_cx_nx ;
|
compile variant_get_by_type_cx.cpp : $(NX) <toolset>msvc-14.0:<build>no : variant_get_by_type_cx_nx ;
|
||||||
|
|
||||||
run variant_subset.cpp throw_exception.cpp : : : $(NX) : variant_subset_nx ;
|
run variant_subset.cpp throw_exception.cpp : : : $(NX) : variant_subset_nx ;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user