diff --git a/test/recursive_wrapper_move_only_test.cpp b/test/recursive_wrapper_move_only_test.cpp index 20c8365..ef8fe1d 100644 --- a/test/recursive_wrapper_move_only_test.cpp +++ b/test/recursive_wrapper_move_only_test.cpp @@ -13,19 +13,29 @@ int main() {} #else #include "boost/core/lightweight_test.hpp" #include -#include +#include +#include +#include +#include #include +// pointer stealing does not care if move can throw struct move_only_type { - explicit move_only_type(int value) noexcept : value_(value) {} - move_only_type(move_only_type&& x) noexcept : value_(x.value_) {} - move_only_type& operator=(move_only_type&& x) noexcept { value_ = x.value_; return *this; } + explicit move_only_type(int value) : value_(value) {} + move_only_type(move_only_type&& x) : value_(x.value_) {} + move_only_type& operator=(move_only_type&& x) { value_ = x.value_; return *this; } int value_; }; -static_assert(std::is_nothrow_move_constructible::value, ""); -static_assert(std::is_nothrow_move_assignable::value, ""); +static_assert(!boost::is_nothrow_move_constructible::value, ""); +#if !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700) +static_assert(!boost::is_nothrow_move_assignable::value, ""); +#else // boostorg/type_traits#114 +namespace boost { +template <> struct is_nothrow_move_assignable : boost::false_type {}; +} +#endif void test_noexcept() { @@ -52,13 +62,13 @@ void test_noexcept() struct throwing_type { - throwing_type() noexcept(false) {} - throwing_type(throwing_type const&) noexcept(false) { throw 0l; } - throwing_type& operator=(throwing_type const&) noexcept(false) { throw 0l; } + throwing_type() {} + throwing_type(throwing_type const&) { throw 0l; } + throwing_type& operator=(throwing_type const&) { throw 0l; } }; -static_assert(!std::is_nothrow_default_constructible::value, ""); -static_assert(!std::is_nothrow_copy_constructible::value, ""); -static_assert(!std::is_nothrow_copy_assignable::value, ""); +static_assert(!boost::has_nothrow_default_constructor::value, ""); +static_assert(!boost::has_nothrow_copy_constructor::value, ""); +//static_assert(!std::is_nothrow_copy_assignable::value, ""); // no boost alternative void test_throwing() {