• 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/assert.hpp>
6 #include <boost/hana/equal.hpp>
7 #include <boost/hana/ext/std/integer_sequence.hpp>
8 #include <boost/hana/ext/std/integral_constant.hpp>
9 #include <boost/hana/unpack.hpp>
10 
11 #include <laws/base.hpp>
12 
13 #include <type_traits>
14 #include <utility>
15 namespace hana = boost::hana;
16 
17 
main()18 int main() {
19     hana::test::_injection<0> f{};
20 
21     BOOST_HANA_CONSTANT_CHECK(hana::equal(
22         hana::unpack(std::integer_sequence<int>{}, f),
23         f()
24     ));
25 
26     BOOST_HANA_CONSTANT_CHECK(hana::equal(
27         hana::unpack(std::integer_sequence<int, 0>{}, f),
28         f(std::integral_constant<int, 0>{})
29     ));
30 
31     BOOST_HANA_CONSTANT_CHECK(hana::equal(
32         hana::unpack(std::integer_sequence<int, 0, 1>{}, f),
33         f(std::integral_constant<int, 0>{}, std::integral_constant<int, 1>{})
34     ));
35 
36     BOOST_HANA_CONSTANT_CHECK(hana::equal(
37         hana::unpack(std::integer_sequence<int, 0, 1, 2>{}, f),
38         f(std::integral_constant<int, 0>{}, std::integral_constant<int, 1>{},
39           std::integral_constant<int, 2>{})
40     ));
41 
42     BOOST_HANA_CONSTANT_CHECK(hana::equal(
43         hana::unpack(std::integer_sequence<int, 0, 1, 2, 3>{}, f),
44         f(std::integral_constant<int, 0>{}, std::integral_constant<int, 1>{},
45           std::integral_constant<int, 2>{}, std::integral_constant<int, 3>{})
46     ));
47 }
48