]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/example/ext/std/tuple.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/equal.hpp>
7 #include <boost/hana/ext/std/tuple.hpp>
8 #include <boost/hana/integral_constant.hpp>
9 #include <boost/hana/transform.hpp>
13 namespace hana
= boost::hana
;
16 struct Fish
{ std::string name
; };
17 struct Cat
{ std::string name
; };
18 struct Dog
{ std::string name
; };
21 std::tuple
<Fish
, Cat
, Dog
> animals
{{"Nemo"}, {"Garfield"}, {"Snoopy"}};
22 hana::front(animals
).name
= "Moby Dick";
24 auto names
= hana::transform(animals
, [](auto a
) {
28 BOOST_HANA_RUNTIME_CHECK(hana::equal(
30 std::make_tuple("Moby Dick", "Garfield", "Snoopy")