]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/callable_traits/example/remove_varargs.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / callable_traits / example / remove_varargs.cpp
1 /*<-
2
3 Copyright Barrett Adair 2016-2017
4
5 Distributed under the Boost Software License, Version 1.0.
6 (See accompanying file LICENSE.md or copy at http ://boost.org/LICENSE_1_0.txt)
7 ->*/
8
9 //[ remove_varargs
10 #include <type_traits>
11 #include <boost/callable_traits/remove_varargs.hpp>
12
13 namespace ct = boost::callable_traits;
14
15 struct foo {};
16
17 int main() {
18
19 {
20 using f = void(int, ...);
21 using expect = void(int);
22 using test = ct::remove_varargs_t<f>;
23 static_assert(std::is_same<test, expect>::value, "");
24 } {
25 using fp = void(*)(...);
26 using expect = void(*)();
27 using test = ct::remove_varargs_t<fp>;
28 static_assert(std::is_same<test, expect>::value, "");
29 } {
30 using fr = void(&)(const char*, ...);
31 using expect = void(&)(const char*);
32 using test = ct::remove_varargs_t<fr>;
33 static_assert(std::is_same<test, expect>::value, "");
34 } {
35 using pmf = void(foo::*)(...) const;
36 using expect = void(foo::*)() const;
37 using test = ct::remove_varargs_t<pmf>;
38 static_assert(std::is_same<test, expect>::value, "");
39 }
40 }
41 //]