]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/bind/test/protect_test2.cpp
3 // Copyright 2020 Peter Dimov
4 // Distributed under the Boost Software License, Version 1.0.
5 // https://www.boost.org/LICENSE_1_0.txt
7 #include <boost/bind/protect.hpp>
8 #include <boost/core/lightweight_test_trait.hpp>
9 #include <boost/core/is_same.hpp>
11 template<class T
, class F
> void test( F
)
13 BOOST_TEST_TRAIT_TRUE((boost::core::is_same
<typename
T::result_type
, typename
F::result_type
>));
18 struct result_type
{};
25 template<class T
, class U
> struct inherit
: T
, U
29 template<class F
> void test2( F
)
31 // test that F doesn't have ::result_type
32 BOOST_TEST_TRAIT_TRUE((boost::core::is_same
<typename inherit
<F
, X
>::result_type
, typename
X::result_type
>));
37 test
<X
>( boost::protect( X() ) );
39 #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_DECLTYPE) && !(defined(BOOST_GCC) && BOOST_GCC < 40600)
41 test2( boost::protect( Y() ) );
45 return boost::report_errors();