// Copyright 2024 Peter Dimov // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt #include #include #include #include struct F { void operator()() { } char operator()( char x1 ) noexcept { return x1; } int operator()( int x1, int x2 ) const { return 10*x1+x2; } double operator()( float x1, float x2, float x3 ) const noexcept { return 100*x1 + 10*x2 + x3; } }; struct X { }; struct Y { Y( int ); Y( double ) noexcept; }; int main() { using boost::compat::is_nothrow_invocable_r; // nonfunction BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); // function reference BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); #if defined(__cpp_noexcept_function_type) BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); #endif BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); // function pointer BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); #if defined(__cpp_noexcept_function_type) BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); #endif BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); // object BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); #if !BOOST_WORKAROUND(BOOST_MSVC, < 1910) BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); #endif BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); // member function pointer BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); #if defined(__cpp_noexcept_function_type) BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); #endif BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); // member data pointer #if !BOOST_WORKAROUND(BOOST_MSVC, < 1910) BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable_r )); #endif BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable_r )); return boost::report_errors(); }