]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/example/sequence/applicative.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)
5 #include <boost/hana/ap.hpp>
6 #include <boost/hana/equal.hpp>
7 #include <boost/hana/ext/std/tuple.hpp>
8 #include <boost/hana/functional/flip.hpp>
9 #include <boost/hana/lift.hpp>
10 #include <boost/hana/pair.hpp>
11 #include <boost/hana/tuple.hpp>
14 namespace hana
= boost::hana
;
17 static_assert(hana::lift
<hana::tuple_tag
>('x') == hana::make_tuple('x'), "");
18 static_assert(hana::equal(hana::lift
<hana::ext::std::tuple_tag
>('x'), std::make_tuple('x')), "");
20 constexpr auto f
= hana::make_pair
;
21 constexpr auto g
= hana::flip(hana::make_pair
);
23 hana::ap(hana::make_tuple(f
, g
), hana::make_tuple(1, 2, 3), hana::make_tuple('a', 'b'))
26 f(1, 'a'), f(1, 'b'), f(2, 'a'), f(2, 'b'), f(3, 'a'), f(3, 'b'),
27 g(1, 'a'), g(1, 'b'), g(2, 'a'), g(2, 'b'), g(3, 'a'), g(3, 'b')