• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/integral_constant.hpp>
6 #include <boost/hana/tuple.hpp>
7 #include <boost/hana/value.hpp>
8 
9 #include <laws/constant.hpp>
10 namespace hana = boost::hana;
11 
12 
main()13 int main() {
14     // value
15     static_assert(hana::value(hana::integral_c<int, 0>) == 0, "");
16     static_assert(hana::value(hana::integral_c<int, 1>) == 1, "");
17 
18 
19     // laws
20     hana::test::TestConstant<hana::integral_constant_tag<int>>{
21         hana::make_tuple(
22             hana::int_c<-10>,
23             hana::int_c<-2>,
24             hana::int_c<0>,
25             hana::int_c<1>,
26             hana::int_c<3>,
27             hana::int_c<4>
28         ),
29         hana::tuple_t<int, long, long long>
30     };
31 
32     hana::test::TestConstant<hana::integral_constant_tag<bool>>{
33         hana::make_tuple(
34             hana::true_c, hana::false_c
35         ),
36         hana::tuple_t<bool>
37     };
38 }
39