]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/example/at_key.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/at_key.hpp>
7 #include <boost/hana/integral_constant.hpp>
8 #include <boost/hana/map.hpp>
9 #include <boost/hana/pair.hpp>
10 #include <boost/hana/type.hpp>
13 namespace hana
= boost::hana
;
17 auto m
= hana::make_map(
18 hana::make_pair(hana::type
<int>{}, std::string
{"int"}),
19 hana::make_pair(hana::int_
<3>{}, std::string
{"3"})
22 BOOST_HANA_RUNTIME_CHECK(hana::at_key(m
, hana::type
<int>{}) == "int");
24 // usage as operator[]
25 BOOST_HANA_RUNTIME_CHECK(m
[hana::type
<int>{}] == "int");
26 BOOST_HANA_RUNTIME_CHECK(m
[hana::int_
<3>{}] == "3");