forked from boostorg/bind
Add protect_test2.cpp
This commit is contained in:
@ -75,3 +75,4 @@ run bind_noexcept_mf_test.cpp ;
|
|||||||
run global_placeholders.cpp ;
|
run global_placeholders.cpp ;
|
||||||
run mem_fn_noexcept_test.cpp ;
|
run mem_fn_noexcept_test.cpp ;
|
||||||
run bind_cpp20_test.cpp ;
|
run bind_cpp20_test.cpp ;
|
||||||
|
run protect_test2.cpp ;
|
||||||
|
26
test/protect_test2.cpp
Normal file
26
test/protect_test2.cpp
Normal 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();
|
||||||
|
}
|
Reference in New Issue
Block a user