]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/ext/boost/tuple/monad_plus.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / hana / test / ext / boost / tuple / monad_plus.cpp
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/ext/boost/tuple.hpp>
6
7 #include <boost/hana/bool.hpp>
8 #include <boost/hana/equal.hpp>
9 #include <boost/hana/functional/always.hpp>
10 #include <boost/hana/tuple.hpp>
11
12 #include <laws/base.hpp>
13 #include <laws/monad_plus.hpp>
14
15 #include <boost/tuple/tuple.hpp>
16 namespace hana = boost::hana;
17
18
19 template <int i>
20 using eq = hana::test::ct_eq<i>;
21
22 int main() {
23 //////////////////////////////////////////////////////////////////////////
24 // Setup for the laws below
25 //////////////////////////////////////////////////////////////////////////
26 auto eq_tuples = hana::make_tuple(
27 ::boost::make_tuple(eq<0>{})
28 , ::boost::make_tuple(eq<0>{}, eq<1>{})
29 , ::boost::make_tuple(eq<0>{}, eq<1>{}, eq<2>{})
30 );
31
32 auto eq_values = hana::make_tuple(eq<0>{}, eq<1>{}, eq<2>{});
33 auto predicates = hana::make_tuple(
34 hana::equal.to(eq<0>{}), hana::equal.to(eq<1>{}), hana::equal.to(eq<2>{}),
35 hana::always(hana::false_c), hana::always(hana::true_c)
36 );
37
38 //////////////////////////////////////////////////////////////////////////
39 // MonadPlus
40 //////////////////////////////////////////////////////////////////////////
41 hana::test::TestMonadPlus<hana::ext::boost::tuple_tag>{eq_tuples, predicates, eq_values};
42 }