]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/ext/std/integral_constant/tag.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / hana / test / ext / std / integral_constant / tag.cpp
1 // Copyright Louis Dionne 2013-2017
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/ext/std/integral_constant.hpp>
6
7 #include <boost/hana/core/tag_of.hpp>
8
9 #include <type_traits>
10 namespace hana = boost::hana;
11
12
13 struct inherit_simple : std::integral_constant<int, 3> { };
14 struct inherit_no_default : std::integral_constant<int, 3> {
15 inherit_no_default() = delete;
16 };
17
18 struct incomplete;
19 struct empty_type { };
20 struct non_pod { virtual ~non_pod() { } };
21
22
23 static_assert(std::is_same<
24 hana::tag_of_t<inherit_simple>,
25 hana::ext::std::integral_constant_tag<int>
26 >{}, "");
27 static_assert(std::is_same<
28 hana::tag_of_t<inherit_no_default>,
29 hana::ext::std::integral_constant_tag<int>
30 >{}, "");
31 static_assert(std::is_same<
32 hana::tag_of_t<std::is_pointer<int*>>,
33 hana::ext::std::integral_constant_tag<bool>
34 >{}, "");
35
36 static_assert(!std::is_same<
37 hana::tag_of_t<incomplete>,
38 hana::ext::std::integral_constant_tag<int>
39 >{}, "");
40 static_assert(!std::is_same<
41 hana::tag_of_t<empty_type>,
42 hana::ext::std::integral_constant_tag<int>
43 >{}, "");
44 static_assert(!std::is_same<
45 hana::tag_of_t<non_pod>,
46 hana::ext::std::integral_constant_tag<int>
47 >{}, "");
48 static_assert(!std::is_same<
49 hana::tag_of_t<void>,
50 hana::ext::std::integral_constant_tag<int>
51 >{}, "");
52
53 int main() { }