]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mp11/test/mp_contains.cpp
2 // Copyright 2015 Peter Dimov.
4 // Distributed under the Boost Software License, Version 1.0.
6 // See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt
10 #include <boost/mp11/algorithm.hpp>
11 #include <boost/mp11/list.hpp>
12 #include <boost/mp11/integral.hpp>
13 #include <boost/core/lightweight_test_trait.hpp>
14 #include <type_traits>
24 using boost::mp11::mp_list
;
25 using boost::mp11::mp_contains
;
26 using boost::mp11::mp_true
;
27 using boost::mp11::mp_false
;
32 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_contains
<L1
, void>, mp_false
>));
34 using L2
= mp_list
<X1
, X2
, X3
, X2
, X3
, X3
>;
36 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_contains
<L2
, void>, mp_false
>));
37 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_contains
<L2
, X1
>, mp_true
>));
38 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_contains
<L2
, X2
>, mp_true
>));
39 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_contains
<L2
, X3
>, mp_true
>));
43 using L3
= std::tuple
<>;
45 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_contains
<L3
, void>, mp_false
>));
47 using L4
= std::tuple
<X1
, X2
, X3
, X2
, X3
, X3
>;
49 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_contains
<L4
, void>, mp_false
>));
50 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_contains
<L4
, X1
>, mp_true
>));
51 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_contains
<L4
, X2
>, mp_true
>));
52 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_contains
<L4
, X3
>, mp_true
>));
56 using L5
= std::pair
<X1
, X2
>;
58 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_contains
<L5
, void>, mp_false
>));
59 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_contains
<L5
, X1
>, mp_true
>));
60 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_contains
<L5
, X2
>, mp_true
>));
63 return boost::report_errors();