]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/callable_traits/example/add_varargs.cpp
2 Copyright Barrett Adair 2016-2017
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE.md or copy at http ://boost.org/LICENSE_1_0.txt)
9 #include <boost/callable_traits/add_varargs.hpp>
11 namespace ct
= boost::callable_traits
;
19 using expect
= void(int, ...);
20 using test
= ct::add_varargs_t
<f
>;
21 static_assert(std::is_same
<test
, expect
>::value
, "");
24 using expect
= void(*)(...);
25 using test
= ct::add_varargs_t
<fp
>;
26 static_assert(std::is_same
<test
, expect
>::value
, "");
28 using fr
= void(&)(const char*);
29 using expect
= void(&)(const char*, ...);
30 using test
= ct::add_varargs_t
<fr
>;
31 static_assert(std::is_same
<test
, expect
>::value
, "");
33 using pmf
= void(foo::*)() const;
34 using expect
= void(foo::*)(...) const;
35 using test
= ct::add_varargs_t
<pmf
>;
36 static_assert(std::is_same
<test
, expect
>::value
, "");
38 // add_varargs_t doesn't change anything when
39 // the type already has varargs.
40 using twice
= ct::add_varargs_t
<test
>;
41 static_assert(std::is_same
<test
, twice
>::value
, "");