]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/concept/struct/find_if.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/assert.hpp>
6 #include <boost/hana/concept/struct.hpp>
7 #include <boost/hana/equal.hpp>
8 #include <boost/hana/find_if.hpp>
9 #include <boost/hana/integral_constant.hpp>
10 #include <boost/hana/optional.hpp>
12 #include "minimal_struct.hpp"
13 #include <laws/base.hpp>
14 namespace hana
= boost::hana
;
15 using hana::test::ct_eq
;
22 BOOST_HANA_CONSTANT_CHECK(hana::equal(
23 hana::find_if(obj(), undefined
<>{}),
27 BOOST_HANA_CONSTANT_CHECK(hana::equal(
28 hana::find_if(obj(ct_eq
<0>{}), hana::equal
.to(hana::int_c
<0>)),
29 hana::just(ct_eq
<0>{})
31 BOOST_HANA_CONSTANT_CHECK(hana::equal(
32 hana::find_if(obj(undefined
<1>{}), hana::equal
.to(hana::int_c
<1>)),
36 BOOST_HANA_CONSTANT_CHECK(hana::equal(
37 hana::find_if(obj(ct_eq
<0>{}, ct_eq
<1>{}), hana::equal
.to(hana::int_c
<0>)),
38 hana::just(ct_eq
<0>{})
40 BOOST_HANA_CONSTANT_CHECK(hana::equal(
41 hana::find_if(obj(ct_eq
<0>{}, ct_eq
<1>{}), hana::equal
.to(hana::int_c
<1>)),
42 hana::just(ct_eq
<1>{})
44 BOOST_HANA_CONSTANT_CHECK(hana::equal(
45 hana::find_if(obj(undefined
<0>{}, undefined
<1>{}), hana::equal
.to(hana::int_c
<2>)),