forked from boostorg/variant2
Disable is_copy_constructible tests on gcc 4.x
This commit is contained in:
@ -9,6 +9,8 @@
|
|||||||
#include <boost/variant2/variant.hpp>
|
#include <boost/variant2/variant.hpp>
|
||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <boost/core/lightweight_test_trait.hpp>
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/config/workaround.hpp>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -124,8 +126,12 @@ int main()
|
|||||||
test( v );
|
test( v );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !BOOST_WORKAROUND( __GNUC__, < 5 )
|
||||||
|
|
||||||
test( variant<D>() );
|
test( variant<D>() );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
BOOST_TEST_TRAIT_TRUE((std::is_nothrow_copy_constructible<variant<int>>));
|
BOOST_TEST_TRAIT_TRUE((std::is_nothrow_copy_constructible<variant<int>>));
|
||||||
BOOST_TEST_TRAIT_TRUE((std::is_nothrow_copy_constructible<variant<int const>>));
|
BOOST_TEST_TRAIT_TRUE((std::is_nothrow_copy_constructible<variant<int const>>));
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include <boost/variant2/variant.hpp>
|
#include <boost/variant2/variant.hpp>
|
||||||
#include <boost/core/lightweight_test_trait.hpp>
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/config/workaround.hpp>
|
||||||
|
|
||||||
#include <boost/mp11.hpp>
|
#include <boost/mp11.hpp>
|
||||||
using namespace boost::mp11;
|
using namespace boost::mp11;
|
||||||
@ -90,13 +91,21 @@ struct test
|
|||||||
{
|
{
|
||||||
using U = mp_inherit<T...>;
|
using U = mp_inherit<T...>;
|
||||||
|
|
||||||
|
#if !BOOST_WORKAROUND( __GNUC__, < 5 )
|
||||||
|
|
||||||
BOOST_TEST_EQ( std::is_copy_constructible<variant<U>>::value, std::is_copy_constructible<U>::value );
|
BOOST_TEST_EQ( std::is_copy_constructible<variant<U>>::value, std::is_copy_constructible<U>::value );
|
||||||
BOOST_TEST_EQ( std::is_nothrow_copy_constructible<variant<U>>::value, std::is_nothrow_copy_constructible<U>::value );
|
BOOST_TEST_EQ( std::is_nothrow_copy_constructible<variant<U>>::value, std::is_nothrow_copy_constructible<U>::value );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1910)
|
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1910)
|
||||||
|
|
||||||
BOOST_TEST_EQ( std::is_move_constructible<variant<U>>::value, std::is_move_constructible<U>::value );
|
BOOST_TEST_EQ( std::is_move_constructible<variant<U>>::value, std::is_move_constructible<U>::value );
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
BOOST_TEST_GE( std::is_move_constructible<variant<U>>::value, std::is_move_constructible<U>::value );
|
BOOST_TEST_GE( std::is_move_constructible<variant<U>>::value, std::is_move_constructible<U>::value );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
BOOST_TEST_EQ( std::is_nothrow_move_constructible<variant<U>>::value, std::is_nothrow_move_constructible<U>::value );
|
BOOST_TEST_EQ( std::is_nothrow_move_constructible<variant<U>>::value, std::is_nothrow_move_constructible<U>::value );
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include <boost/variant2/variant.hpp>
|
#include <boost/variant2/variant.hpp>
|
||||||
#include <boost/core/lightweight_test_trait.hpp>
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/config/workaround.hpp>
|
||||||
|
|
||||||
#include <boost/mp11.hpp>
|
#include <boost/mp11.hpp>
|
||||||
using namespace boost::mp11;
|
using namespace boost::mp11;
|
||||||
@ -91,8 +92,13 @@ struct test
|
|||||||
{
|
{
|
||||||
using U = mp_inherit<T...>;
|
using U = mp_inherit<T...>;
|
||||||
|
|
||||||
|
#if !BOOST_WORKAROUND( __GNUC__, < 5 )
|
||||||
|
|
||||||
BOOST_TEST_EQ( v2d::is_trivially_copy_constructible<variant<U>>::value, v2d::is_trivially_copy_constructible<U>::value );
|
BOOST_TEST_EQ( v2d::is_trivially_copy_constructible<variant<U>>::value, v2d::is_trivially_copy_constructible<U>::value );
|
||||||
BOOST_TEST_EQ( v2d::is_trivially_copy_assignable<variant<U>>::value, std::is_trivially_destructible<U>::value && v2d::is_trivially_copy_constructible<U>::value && v2d::is_trivially_copy_assignable<U>::value );
|
BOOST_TEST_EQ( v2d::is_trivially_copy_assignable<variant<U>>::value, std::is_trivially_destructible<U>::value && v2d::is_trivially_copy_constructible<U>::value && v2d::is_trivially_copy_assignable<U>::value );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
BOOST_TEST_EQ( std::is_trivially_destructible<variant<U>>::value, std::is_trivially_destructible<U>::value );
|
BOOST_TEST_EQ( std::is_trivially_destructible<variant<U>>::value, std::is_trivially_destructible<U>::value );
|
||||||
|
|
||||||
#if !BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION, < 50000)
|
#if !BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION, < 50000)
|
||||||
|
Reference in New Issue
Block a user