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