]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/example/struct/to.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/core/to.hpp>
7 #include <boost/hana/define_struct.hpp>
8 #include <boost/hana/equal.hpp>
9 #include <boost/hana/map.hpp>
10 #include <boost/hana/pair.hpp>
11 #include <boost/hana/string.hpp>
14 namespace hana
= boost::hana
;
18 BOOST_HANA_DEFINE_STRUCT(Person
,
25 Person john
{"John", 30u};
26 BOOST_HANA_RUNTIME_CHECK(hana::to
<hana::map_tag
>(john
) == hana::make_map(
27 hana::make_pair(BOOST_HANA_STRING("name"), "John"),
28 hana::make_pair(BOOST_HANA_STRING("age"), 30u)