]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/hana/example/optional/searchable.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / hana / example / optional / searchable.cpp
CommitLineData
b32b8144 1// Copyright Louis Dionne 2013-2017
7c673cae
FG
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/all_of.hpp>
6#include <boost/hana/assert.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/mod.hpp>
11#include <boost/hana/not_equal.hpp>
12#include <boost/hana/optional.hpp>
13namespace hana = boost::hana;
14
15
16auto odd = [](auto x) {
17 return x % hana::int_c<2> != hana::int_c<0>;
18};
19
20BOOST_HANA_CONSTANT_CHECK(hana::find_if(hana::just(hana::int_c<3>), odd) == hana::just(hana::int_c<3>));
21BOOST_HANA_CONSTANT_CHECK(hana::find_if(hana::just(hana::int_c<2>), odd) == hana::nothing);
22BOOST_HANA_CONSTANT_CHECK(hana::find_if(hana::nothing, odd) == hana::nothing);
23
24BOOST_HANA_CONSTANT_CHECK(hana::all_of(hana::just(hana::int_c<3>), odd));
25BOOST_HANA_CONSTANT_CHECK(hana::all_of(hana::nothing, odd));
26
27int main() { }