// // sp_nothrow_test.cpp // // Copyright 2016 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // #include #if defined( BOOST_NO_CXX11_HDR_TYPE_TRAITS ) int main() { } #else #include #include #include #include #include #include #include #include #include template void test_copy() { BOOST_TEST_TRAIT_TRUE(( std::is_nothrow_copy_constructible )); BOOST_TEST_TRAIT_TRUE(( std::is_nothrow_copy_assignable )); } template void test_move() { BOOST_TEST_TRAIT_TRUE(( std::is_nothrow_move_constructible )); BOOST_TEST_TRAIT_TRUE(( std::is_nothrow_move_assignable )); } template void test_default() { BOOST_TEST_TRAIT_TRUE(( std::is_nothrow_default_constructible )); } template void test_destroy() { BOOST_TEST_TRAIT_TRUE(( std::is_nothrow_destructible )); } template void test_cmd() { test_copy(); test_move(); test_default(); } struct X { }; struct Y: public boost::enable_shared_from_this { }; int main() { test_cmd< boost::shared_ptr >(); test_cmd< boost::shared_array >(); test_cmd< boost::weak_ptr >(); test_copy< Y >(); test_default< Y >(); test_destroy< Y >(); // test_move< Y >(); BOOST_TEST_TRAIT_TRUE(( std::is_nothrow_move_constructible )); #if !( defined( BOOST_MSVC ) && BOOST_MSVC == 1700 ) BOOST_TEST_TRAIT_TRUE(( std::is_nothrow_move_assignable )); #endif test_default< boost::scoped_ptr >(); test_default< boost::scoped_array >(); test_move< boost::intrusive_ptr >(); test_default< boost::intrusive_ptr >(); return boost::report_errors(); } #endif // #if defined( BOOST_NO_CXX11_HDR_TYPE_TRAITS )