Update nothrow_constructible tests.

This commit is contained in:
jzmaddock
2015-06-08 09:06:16 +01:00
parent 719ea20756
commit 7a0c636208

View File

@ -12,6 +12,33 @@
# include <boost/type_traits/has_nothrow_copy.hpp>
#endif
struct non_copy
{
non_copy();
private:
non_copy(const non_copy&);
};
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
struct delete_copy
{
delete_copy();
delete_copy(const delete_copy&) = delete;
};
#endif
#ifndef BOOST_NO_CXX11_NOEXCEPT
struct noexcept_copy
{
noexcept_copy();
noexcept_copy& operator=(const non_copy&)noexcept;
};
#endif
TT_TEST_BEGIN(has_nothrow_copy)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<bool>::value, true);
@ -201,6 +228,16 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<nothrow_construct_UDT>::val
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<test_abc1>::value, false);
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<delete_copy>::value, false);
#endif
#ifndef BOOST_NO_CXX11_NOEXCEPT
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<noexcept_copy>::value, true);
#endif
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<non_copy>::value, false);
TT_TEST_END