]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mp11/test/mp_map_find_2.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / mp11 / test / mp_map_find_2.cpp
1
2 // Copyright 2016, 2020 Peter Dimov.
3 //
4 // Distributed under the Boost Software License, Version 1.0.
5 //
6 // See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt
8
9
10 #include <boost/mp11/map.hpp>
11 #include <boost/core/lightweight_test_trait.hpp>
12 #include <tuple>
13
14 struct X {};
15 struct Y {};
16
17 int main()
18 {
19 using boost::mp11::mp_map_find;
20
21 using L1 = std::tuple<std::tuple<int, int>, std::tuple<long, long>, std::tuple<bool, X>, std::tuple<X, bool>>;
22
23 BOOST_TEST_TRAIT_SAME( mp_map_find<L1, int>, std::tuple<int, int> );
24 BOOST_TEST_TRAIT_SAME( mp_map_find<L1, bool>, std::tuple<bool, X> );
25 BOOST_TEST_TRAIT_SAME( mp_map_find<L1, X>, std::tuple<X, bool> );
26
27 using L2 = std::tuple<std::tuple<X, Y>, std::tuple<Y, X>>;
28
29 BOOST_TEST_TRAIT_SAME( mp_map_find<L2, X>, std::tuple<X, Y> );
30 BOOST_TEST_TRAIT_SAME( mp_map_find<L2, Y>, std::tuple<Y, X> );
31
32 return boost::report_errors();
33 }