]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_traits/test/conjunction_test.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / type_traits / test / conjunction_test.cpp
1 /*
2 Copyright 2020 Glen Joseph Fernandes
3 (glenjofe@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 #ifdef TEST_STD
10 #include <type_traits>
11 #else
12 #include <boost/type_traits/conjunction.hpp>
13 #endif
14 #include "check_integral_constant.hpp"
15
16 template<int V>
17 struct Int {
18 static const int value = V;
19 };
20
21 TT_TEST_BEGIN(conjunction)
22
23 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::conjunction<Int<2>, Int<4> >::value), 4);
24 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::conjunction<Int<0>, Int<4> >::value), 0);
25
26 #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
27 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::conjunction<Int<2>, Int<4>, Int<6>,
28 Int<8>, Int<10> >::value), 10);
29 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::conjunction<Int<2>, Int<0>, Int<4>,
30 Int<6>, Int<8> >::value), 0);
31 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::conjunction<Int<4> >::value, 4);
32 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::conjunction<>::value, true);
33 #endif
34
35 TT_TEST_END