]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/string/find_if.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / hana / test / string / 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)
4
5 #include <boost/hana/assert.hpp>
6 #include <boost/hana/bool.hpp>
7 #include <boost/hana/equal.hpp>
8 #include <boost/hana/find_if.hpp>
9 #include <boost/hana/functional/always.hpp>
10 #include <boost/hana/integral_constant.hpp>
11 #include <boost/hana/optional.hpp>
12 #include <boost/hana/string.hpp>
13 namespace hana = boost::hana;
14
15
16 int main() {
17 BOOST_HANA_CONSTANT_CHECK(hana::equal(
18 hana::find_if(BOOST_HANA_STRING(""), hana::always(hana::true_c)),
19 hana::nothing
20 ));
21
22 BOOST_HANA_CONSTANT_CHECK(hana::equal(
23 hana::find_if(BOOST_HANA_STRING("abcd"), hana::equal.to(hana::char_c<'a'>)),
24 hana::just(hana::char_c<'a'>)
25 ));
26
27 BOOST_HANA_CONSTANT_CHECK(hana::equal(
28 hana::find_if(BOOST_HANA_STRING("abcd"), hana::equal.to(hana::char_c<'c'>)),
29 hana::just(hana::char_c<'c'>)
30 ));
31
32 BOOST_HANA_CONSTANT_CHECK(hana::equal(
33 hana::find_if(BOOST_HANA_STRING("abcd"), hana::equal.to(hana::char_c<'d'>)),
34 hana::just(hana::char_c<'d'>)
35 ));
36 }