]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/hana/test/ext/boost/tuple/tag_of.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / hana / test / ext / boost / tuple / tag_of.cpp
CommitLineData
b32b8144 1// Copyright Louis Dionne 2013-2017
7c673cae
FG
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
4
5#include <boost/hana/core/tag_of.hpp>
6#include <boost/hana/ext/boost/tuple.hpp>
7
8#include <boost/tuple/tuple.hpp>
9
10#include <type_traits>
11namespace hana = boost::hana;
12
13
14int main() {
15 //////////////////////////////////////////////////////////////////////////
16 // make sure the tag is correct
17 //////////////////////////////////////////////////////////////////////////
18 {
19 auto make_cons = [](auto x, auto xs) {
20 return boost::tuples::cons<decltype(x), decltype(xs)>{x, xs};
21 };
22
23 static_assert(std::is_same<
24 hana::tag_of_t<decltype(boost::make_tuple())>,
25 hana::ext::boost::tuple_tag
26 >::value, "");
27
28 static_assert(std::is_same<
29 hana::tag_of_t<decltype(boost::make_tuple(1))>,
30 hana::ext::boost::tuple_tag
31 >::value, "");
32
33 static_assert(std::is_same<
34 hana::tag_of_t<decltype(boost::make_tuple(1, '2'))>,
35 hana::ext::boost::tuple_tag
36 >::value, "");
37
38 static_assert(std::is_same<
39 hana::tag_of_t<decltype(boost::make_tuple(1, '2', 3.3))>,
40 hana::ext::boost::tuple_tag
41 >::value, "");
42
43 static_assert(std::is_same<
44 hana::tag_of_t<decltype(make_cons(1, boost::tuples::null_type{}))>,
45 hana::ext::boost::tuple_tag
46 >::value, "");
47
48 static_assert(std::is_same<
49 hana::tag_of_t<decltype(make_cons(1, make_cons('2', boost::tuples::null_type{})))>,
50 hana::ext::boost::tuple_tag
51 >::value, "");
52
53 static_assert(std::is_same<
54 hana::tag_of_t<decltype(make_cons(1, boost::make_tuple('2', 3.3)))>,
55 hana::ext::boost::tuple_tag
56 >::value, "");
57
58 static_assert(std::is_same<
59 hana::tag_of_t<boost::tuples::null_type>,
60 hana::ext::boost::tuple_tag
61 >::value, "");
62 }
63}