]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mp11/test/mp_min_element.cpp
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
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>
17 using boost::mp11::mp_bool
;
19 template<class T
, class U
> using sizeof_less
= mp_bool
<(sizeof(T
) < sizeof(U
))>;
23 using boost::mp11::mp_list
;
24 using boost::mp11::mp_min_element
;
27 using L1
= mp_list
<void>;
29 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_min_element
<L1
, sizeof_less
>, void>));
31 using L2
= mp_list
<char[2], char[4], char[3], char[1]>;
33 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_min_element
<L2
, sizeof_less
>, char[1]>));
35 using L3
= mp_list
<char[2], char[4], char[2], char[3], char[1], char[2], char[1]>;
37 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_min_element
<L3
, sizeof_less
>, char[1]>));
41 using L1
= std::tuple
<void>;
43 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_min_element
<L1
, sizeof_less
>, void>));
45 using L2
= std::tuple
<char[2], char[4], char[3], char[1]>;
47 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_min_element
<L2
, sizeof_less
>, char[1]>));
49 using L3
= std::tuple
<char[2], char[4], char[2], char[3], char[1], char[2], char[1]>;
51 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_min_element
<L3
, sizeof_less
>, char[1]>));
54 return boost::report_errors();