]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/callable_traits/example/is_noexcept.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / callable_traits / example / is_noexcept.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
10 #ifndef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
11 int main(){}
12 #else
13
14 //[ is_noexcept
15 #include <boost/callable_traits/is_noexcept.hpp>
16
17 namespace ct = boost::callable_traits;
18
19 struct foo;
20
21 static_assert(ct::is_noexcept<int() noexcept>::value, "");
22 static_assert(ct::is_noexcept<int(*)() noexcept>::value, "");
23 static_assert(ct::is_noexcept<int(&)() noexcept>::value, "");
24 static_assert(ct::is_noexcept<int(foo::*)() const noexcept>::value, "");
25
26 static_assert(!ct::is_noexcept<int()>::value, "");
27 static_assert(!ct::is_noexcept<int(*)()>::value, "");
28 static_assert(!ct::is_noexcept<int(&)()>::value, "");
29 static_assert(!ct::is_noexcept<int(foo::*)() const>::value, "");
30
31 int main() {}
32 //]
33 #endif