]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/example/unfold_right.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / hana / example / unfold_right.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/assert.hpp>
6 #include <boost/hana/equal.hpp>
7 #include <boost/hana/if.hpp>
8 #include <boost/hana/integral_constant.hpp>
9 #include <boost/hana/minus.hpp>
10 #include <boost/hana/optional.hpp>
11 #include <boost/hana/pair.hpp>
12 #include <boost/hana/tuple.hpp>
13 #include <boost/hana/unfold_right.hpp>
14 namespace hana = boost::hana;
15
16
17 BOOST_HANA_CONSTANT_CHECK(
18 hana::unfold_right<hana::tuple_tag>(hana::int_c<10>, [](auto x) {
19 return hana::if_(x == hana::int_c<0>,
20 hana::nothing,
21 hana::just(hana::make_pair(x, x - hana::int_c<1>))
22 );
23 })
24 ==
25 hana::tuple_c<int, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1>
26 );
27
28 int main() { }