]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/example/struct/searchable.cpp
ce25f182b89a0f638c07afefb025362eabfc00c7
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/define_struct.hpp>
7 #include <boost/hana/equal.hpp>
8 #include <boost/hana/find.hpp>
9 #include <boost/hana/optional.hpp>
10 #include <boost/hana/string.hpp>
13 namespace hana
= boost::hana
;
17 BOOST_HANA_DEFINE_STRUCT(Person
,
24 Person john
{"John", 30};
26 BOOST_HANA_RUNTIME_CHECK(
27 hana::find(john
, BOOST_HANA_STRING("name")) == hana::just("John")
30 BOOST_HANA_CONSTANT_CHECK(
31 hana::find(john
, BOOST_HANA_STRING("foobar")) == hana::nothing