1// Copyright Louis Dionne 2013-2022
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/std/integral_constant.hpp>
7#include <boost/hana/integral_constant.hpp>
8#include <boost/hana/pair.hpp>
9
10#include <type_traits>
11namespace hana = boost::hana;
12
13
14int main() {
15 {
16 struct T { }; struct U { };
17 static_assert(std::is_same<
18 hana::tag_of<hana::pair<T, U>>::type,
19 hana::pair_tag
20 >{}, "");
21 }
22
23 // Bug #1
24 {
25 using Pair = hana::pair<hana::integral_constant<int, 3>, int>;
26 using PairTag = hana::tag_of<Pair>::type;
27 using Tag = hana::tag_of<std::integral_constant<unsigned long, 0>>::type;
28 }
29
30 // Bug #2
31 {
32 using Pair = hana::pair<std::integral_constant<int, 3>, int>;
33 using PairTag = hana::tag_of<Pair>::type;
34 using Tag = hana::tag_of<std::integral_constant<unsigned long, 0>>::type;
35 }
36}
37

source code of boost/libs/hana/test/pair/tag_of.cpp