]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/experimental/printable/map.cpp
7805678ce04ea3370c3012a253b1dd1f477b20cf
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/experimental/printable.hpp>
7 #include <boost/hana/integral_constant.hpp>
8 #include <boost/hana/map.hpp>
9 #include <boost/hana/pair.hpp>
13 namespace hana
= boost::hana
;
18 std::ostringstream ss
;
19 ss
<< hana::experimental::print(
22 BOOST_HANA_RUNTIME_CHECK(ss
.str() == "{}");
26 std::ostringstream ss
;
27 ss
<< hana::experimental::print(
28 hana::make_map(hana::make_pair(hana::int_c
<1>, 'x'))
30 BOOST_HANA_RUNTIME_CHECK(ss
.str() == "{1 => x}");
34 std::ostringstream ss
;
35 ss
<< hana::experimental::print(
36 hana::make_map(hana::make_pair(hana::int_c
<1>, 'x'),
37 hana::make_pair(hana::int_c
<2>, 'y'))
39 BOOST_HANA_RUNTIME_CHECK(ss
.str() == "{1 => x, 2 => y}");
43 std::ostringstream ss
;
44 ss
<< hana::experimental::print(
45 hana::make_map(hana::make_pair(hana::int_c
<1>, 'x'),
46 hana::make_pair(hana::int_c
<2>, 'y'),
47 hana::make_pair(hana::int_c
<3>, 'z'))
49 BOOST_HANA_RUNTIME_CHECK(ss
.str() == "{1 => x, 2 => y, 3 => z}");