1
0
forked from boostorg/bind

Add protect_test2.cpp

This commit is contained in:
Peter Dimov
2020-06-30 21:39:22 +03:00
parent 3cbcd02965
commit 1aac698358
2 changed files with 27 additions and 0 deletions

View File

@ -75,3 +75,4 @@ run bind_noexcept_mf_test.cpp ;
run global_placeholders.cpp ;
run mem_fn_noexcept_test.cpp ;
run bind_cpp20_test.cpp ;
run protect_test2.cpp ;

26
test/protect_test2.cpp Normal file
View File

@ -0,0 +1,26 @@
// protect_test2.cpp
//
// Copyright 2020 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/bind/protect.hpp>
#include <boost/core/lightweight_test_trait.hpp>
#include <boost/core/is_same.hpp>
template<class T, class F> void test( F )
{
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<typename T::result_type, typename F::result_type>));
}
struct X
{
struct result_type {};
};
int main()
{
test<X>( boost::protect( X() ) );
return boost::report_errors();
}