]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/map/any_of.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/any_of.hpp>
6 #include <boost/hana/assert.hpp>
7 #include <boost/hana/equal.hpp>
8 #include <boost/hana/map.hpp>
9 #include <boost/hana/not.hpp>
11 #include <laws/base.hpp>
12 #include <support/minimal_product.hpp>
13 namespace hana
= boost::hana
;
17 auto key() { return hana::test::ct_eq
<i
>{}; }
20 auto val() { return hana::test::ct_eq
<-i
>{}; }
22 template <int i
, int j
>
23 auto p() { return ::minimal_product(key
<i
>(), val
<j
>()); }
26 BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::any_of(
28 hana::equal
.to(key
<1>()
31 BOOST_HANA_CONSTANT_CHECK(hana::any_of(
32 hana::make_map(p
<1, 1>()),
33 hana::equal
.to(key
<1>())
35 BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::any_of(
36 hana::make_map(p
<1, 1>()),
37 hana::equal
.to(key
<2>())
40 BOOST_HANA_CONSTANT_CHECK(hana::any_of(
41 hana::make_map(p
<1, 1>(), p
<2, 2>()),
42 hana::equal
.to(key
<1>())
44 BOOST_HANA_CONSTANT_CHECK(hana::any_of(
45 hana::make_map(p
<1, 1>(), p
<2, 2>()),
46 hana::equal
.to(key
<2>())
48 BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::any_of(
49 hana::make_map(p
<1, 1>(), p
<2, 2>()),
50 hana::equal
.to(key
<3>())