]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mp11/test/mp_same.cpp
d23e6b79bc0d97eb318e89d7e344147b28c52d05
2 // Copyright 2017 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
9 #include <boost/mp11/detail/config.hpp>
12 # pragma warning( disable: 4503 ) // decorated name length exceeded
15 #include <boost/mp11/function.hpp>
16 #include <boost/mp11/algorithm.hpp>
17 #include <boost/mp11/list.hpp>
18 #include <boost/core/lightweight_test_trait.hpp>
19 #include <type_traits>
23 using boost::mp11::mp_same
;
24 using boost::mp11::mp_true
;
25 using boost::mp11::mp_false
;
27 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_same
<>, mp_true
>));
28 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_same
<void>, mp_true
>));
29 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_same
<void, void>, mp_true
>));
30 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_same
<void, void, void>, mp_true
>));
31 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_same
<void, void, void, void>, mp_true
>));
32 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_same
<void, void, void, void, void>, mp_true
>));
34 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_same
<void, int>, mp_false
>));
35 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_same
<void, void, int>, mp_false
>));
36 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_same
<void, void, void, int>, mp_false
>));
37 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_same
<void, void, void, void, int>, mp_false
>));
39 using boost::mp11::mp_repeat_c
;
40 using boost::mp11::mp_list
;
41 using boost::mp11::mp_apply
;
45 using L
= mp_repeat_c
<mp_list
<void>, N
>;
46 using R
= mp_apply
<mp_same
, L
>;
48 BOOST_TEST_TRAIT_TRUE((std::is_same
<R
, mp_true
>));
50 return boost::report_errors();