Imported Upstream version 1.64.0
[platform/upstream/boost.git] / libs / hana / test / detail / type_at.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/detail/type_at.hpp>
6
7 #include <type_traits>
8 namespace hana = boost::hana;
9
10
11 template <int>
12 struct x;
13
14 static_assert(std::is_same<
15     hana::detail::type_at<0, x<0>>::type,
16     x<0>
17 >{}, "");
18 static_assert(std::is_same<
19     hana::detail::type_at<0, x<0>, x<1>>::type,
20     x<0>
21 >{}, "");
22 static_assert(std::is_same<
23     hana::detail::type_at<0, x<0>, x<1>, x<2>>::type,
24     x<0>
25 >{}, "");
26
27 static_assert(std::is_same<
28     hana::detail::type_at<1, x<0>, x<1>>::type,
29     x<1>
30 >{}, "");
31 static_assert(std::is_same<
32     hana::detail::type_at<1, x<0>, x<1>, x<2>>::type,
33     x<1>
34 >{}, "");
35 static_assert(std::is_same<
36     hana::detail::type_at<1, x<0>, x<1>, x<2>, x<3>>::type,
37     x<1>
38 >{}, "");
39
40 static_assert(std::is_same<
41     hana::detail::type_at<2, x<0>, x<1>, x<2>>::type,
42     x<2>
43 >{}, "");
44 static_assert(std::is_same<
45     hana::detail::type_at<2, x<0>, x<1>, x<2>, x<3>>::type,
46     x<2>
47 >{}, "");
48 static_assert(std::is_same<
49     hana::detail::type_at<2, x<0>, x<1>, x<2>, x<3>, x<4>>::type,
50     x<2>
51 >{}, "");
52
53 static_assert(std::is_same<
54     hana::detail::type_at<3, x<0>, x<1>, x<2>, x<3>>::type,
55     x<3>
56 >{}, "");
57 static_assert(std::is_same<
58     hana::detail::type_at<3, x<0>, x<1>, x<2>, x<3>, x<4>>::type,
59     x<3>
60 >{}, "");
61 static_assert(std::is_same<
62     hana::detail::type_at<3, x<0>, x<1>, x<2>, x<3>, x<4>, x<5>>::type,
63     x<3>
64 >{}, "");
65
66 static_assert(std::is_same<
67     hana::detail::type_at<4, x<0>, x<1>, x<2>, x<3>, x<4>>::type,
68     x<4>
69 >{}, "");
70 static_assert(std::is_same<
71     hana::detail::type_at<4, x<0>, x<1>, x<2>, x<3>, x<4>, x<5>>::type,
72     x<4>
73 >{}, "");
74 static_assert(std::is_same<
75     hana::detail::type_at<4, x<0>, x<1>, x<2>, x<3>, x<4>, x<5>, x<6>>::type,
76     x<4>
77 >{}, "");
78
79 static_assert(std::is_same<
80     hana::detail::type_at<5, x<0>, x<1>, x<2>, x<3>, x<4>, x<5>>::type,
81     x<5>
82 >{}, "");
83 static_assert(std::is_same<
84     hana::detail::type_at<5, x<0>, x<1>, x<2>, x<3>, x<4>, x<5>, x<6>>::type,
85     x<5>
86 >{}, "");
87 static_assert(std::is_same<
88     hana::detail::type_at<5, x<0>, x<1>, x<2>, x<3>, x<4>, x<5>, x<6>, x<7>>::type,
89     x<5>
90 >{}, "");
91
92 static_assert(std::is_same<
93     hana::detail::type_at<6, x<0>, x<1>, x<2>, x<3>, x<4>, x<5>, x<6>>::type,
94     x<6>
95 >{}, "");
96
97 static_assert(std::is_same<
98     hana::detail::type_at<7, x<0>, x<1>, x<2>, x<3>, x<4>, x<5>, x<6>, x<7>>::type,
99     x<7>
100 >{}, "");
101
102 int main() { }