]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_traits/test/detected_or_test.cpp
2 Copyright 2017 Glen Joseph Fernandes
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)
9 #include <boost/config.hpp>
10 #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \
11 !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
13 #include <type_traits>
15 #include <boost/type_traits/detected_or.hpp>
17 #include "check_integral_constant.hpp"
18 #include "check_type.hpp"
20 #define CHECK_FALSE(e) BOOST_CHECK_INTEGRAL_CONSTANT(e, false)
21 #define CHECK_TRUE(e) BOOST_CHECK_INTEGRAL_CONSTANT(e, true)
24 using type_t
= typename
T::type
;
32 TT_TEST_BEGIN(detected_or
)
34 CHECK_FALSE((::tt::detected_or
<bool, type_t
, int>::value_t::value
));
35 CHECK_TRUE((::tt::detected_or
<bool, type_t
, has_type
>::value_t::value
));
36 CHECK_FALSE((::tt::detected_or
<bool, type_t
, no_type
>::value_t::value
));
37 BOOST_CHECK_TYPE4(::tt::detected_or
<bool, type_t
, int>::type
, bool);
38 BOOST_CHECK_TYPE4(::tt::detected_or
<bool, type_t
, has_type
>::type
, char);
39 BOOST_CHECK_TYPE4(::tt::detected_or
<bool, type_t
, no_type
>::type
, bool);
40 BOOST_CHECK_TYPE4(::tt::detected_or_t
<bool, type_t
, int>, bool);
41 BOOST_CHECK_TYPE4(::tt::detected_or_t
<bool, type_t
, has_type
>, char);
42 BOOST_CHECK_TYPE4(::tt::detected_or_t
<bool, type_t
, no_type
>, bool);