Imported Upstream version 1.64.0
[platform/upstream/boost.git] / libs / hana / test / ext / std / integral_constant / constant.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/tuple.hpp>
8 #include <boost/hana/value.hpp>
9
10 #include <laws/constant.hpp>
11
12 #include <type_traits>
13 namespace hana = boost::hana;
14
15
16 int main() {
17     // value
18     static_assert(hana::value(std::integral_constant<int, 0>{}) == 0, "");
19     static_assert(hana::value(std::integral_constant<int, 1>{}) == 1, "");
20     static_assert(hana::value(std::integral_constant<int, 3>{}) == 3, "");
21
22     // laws
23     hana::test::TestConstant<hana::ext::std::integral_constant_tag<int>>{
24         hana::make_tuple(
25             std::integral_constant<int, -10>{},
26             std::integral_constant<int, -2>{},
27             std::integral_constant<int, 0>{},
28             std::integral_constant<int, 1>{},
29             std::integral_constant<int, 3>{}
30         ),
31         hana::tuple_t<int, long, long long>
32     };
33 }