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