]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_traits/test/detected_test.cpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / libs / type_traits / test / detected_test.cpp
1 /*
2 Copyright 2017 Glen Joseph Fernandes
3 <glenjofe -at- gmail.com>
4
5 Distributed under the Boost Software License,
6 Version 1.0. (See accompanying file LICENSE_1_0.txt
7 or copy at http://www.boost.org/LICENSE_1_0.txt)
8 */
9 #include <boost/config.hpp>
10 #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \
11 !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
12 #ifdef TEST_STD
13 #include <type_traits>
14 #else
15 #include <boost/type_traits/detected.hpp>
16 #endif
17 #include "check_integral_constant.hpp"
18 #include "check_type.hpp"
19
20 #define CHECK_FALSE(e) BOOST_CHECK_INTEGRAL_CONSTANT(e, false)
21 #define CHECK_TRUE(e) BOOST_CHECK_INTEGRAL_CONSTANT(e, true)
22
23 template<class T>
24 using type_t = typename T::type;
25
26 struct has_type {
27 using type = char;
28 };
29
30 struct no_type { };
31
32 TT_TEST_BEGIN(detected)
33
34 BOOST_CHECK_TYPE3(::tt::detected_t<type_t, int>, boost::nonesuch);
35 BOOST_CHECK_TYPE3(::tt::detected_t<type_t, has_type>, char);
36 BOOST_CHECK_TYPE3(::tt::detected_t<type_t, no_type>, boost::nonesuch);
37
38 TT_TEST_END
39 #else
40 int main()
41 {
42 return 0;
43 }
44 #endif