]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/set/find_if.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)
5 #include <boost/hana/assert.hpp>
6 #include <boost/hana/at_key.hpp>
7 #include <boost/hana/equal.hpp>
8 #include <boost/hana/find_if.hpp>
9 #include <boost/hana/optional.hpp>
10 #include <boost/hana/set.hpp>
12 #include <laws/base.hpp>
13 namespace hana
= boost::hana
;
14 using hana::test::ct_eq
;
18 BOOST_HANA_CONSTANT_CHECK(hana::equal(
19 hana::find_if(hana::make_set(), hana::equal
.to(ct_eq
<1>{})),
23 BOOST_HANA_CONSTANT_CHECK(hana::equal(
24 hana::find_if(hana::make_set(ct_eq
<1>{}), hana::equal
.to(ct_eq
<1>{})),
25 hana::just(ct_eq
<1>{})
27 BOOST_HANA_CONSTANT_CHECK(hana::equal(
28 hana::find_if(hana::make_set(ct_eq
<1>{}), hana::equal
.to(ct_eq
<2>{})),
32 BOOST_HANA_CONSTANT_CHECK(hana::equal(
33 hana::find_if(hana::make_set(ct_eq
<1>{}, ct_eq
<2>{}), hana::equal
.to(ct_eq
<1>{})),
34 hana::just(ct_eq
<1>{})
36 BOOST_HANA_CONSTANT_CHECK(hana::equal(
37 hana::find_if(hana::make_set(ct_eq
<1>{}, ct_eq
<2>{}), hana::equal
.to(ct_eq
<2>{})),
38 hana::just(ct_eq
<2>{})
40 BOOST_HANA_CONSTANT_CHECK(hana::equal(
41 hana::find_if(hana::make_set(ct_eq
<1>{}, ct_eq
<2>{}), hana::equal
.to(ct_eq
<3>{})),
45 // find with operators
46 BOOST_HANA_CONSTANT_CHECK(hana::equal(
47 hana::make_set(ct_eq
<1>{})[ct_eq
<1>{}],