]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/hana/test/ext/std/integer_sequence/unpack.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / hana / test / ext / std / integer_sequence / unpack.cpp
CommitLineData
7c673cae
FG
1// Copyright Louis Dionne 2013-2016
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>
15namespace hana = boost::hana;
16
17
18int 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}