]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/function_types/test/synthesis/variadic_function_synthesis.cpp
2 // (C) Copyright Tobias Schwinger
4 // Use modification and distribution are subject to the boost Software License,
5 // Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
7 //------------------------------------------------------------------------------
9 #include <boost/mpl/assert.hpp>
10 #include <boost/mpl/vector.hpp>
11 #include <boost/type_traits/is_same.hpp>
13 #include <boost/function_types/function_type.hpp>
14 #include <boost/function_types/function_pointer.hpp>
15 #include <boost/function_types/function_reference.hpp>
16 #include <boost/function_types/member_function_pointer.hpp>
18 namespace ft
= boost::function_types
;
19 namespace mpl
= boost::mpl
;
23 typedef int expected_v_1(...);
24 typedef int expected_nv_1();
25 typedef int (C::*expected_v_2
)(...);
26 typedef int (C::*expected_nv_2
)();
28 BOOST_MPL_ASSERT(( is_same
<
29 ft::function_type
<mpl::vector
<int>, ft::variadic
>::type
, expected_v_1
32 BOOST_MPL_ASSERT(( is_same
<
33 ft::function_type
<mpl::vector
<int>, ft::non_variadic
>::type
, expected_nv_1
36 BOOST_MPL_ASSERT(( is_same
<
37 ft::function_pointer
<mpl::vector
<int>, ft::variadic
>::type
, expected_v_1
*
40 BOOST_MPL_ASSERT(( is_same
<
41 ft::function_pointer
<mpl::vector
<int>, ft::non_variadic
>::type
45 BOOST_MPL_ASSERT(( is_same
<
46 ft::function_reference
<mpl::vector
<int>, ft::variadic
>::type
, expected_v_1
&
49 BOOST_MPL_ASSERT(( is_same
<
50 ft::function_reference
<mpl::vector
<int>, ft::non_variadic
>::type
54 BOOST_MPL_ASSERT(( is_same
<
55 ft::member_function_pointer
<mpl::vector
<int,C
>, ft::variadic
>::type
59 BOOST_MPL_ASSERT(( is_same
<
60 ft::member_function_pointer
<mpl::vector
<int,C
>, ft::non_variadic
>::type