]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/example/tutorial/ext/fusion_to_hana.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/for_each.hpp>
6 #include <boost/hana/tuple.hpp>
7 #include <boost/hana/ext/boost/fusion/vector.hpp>
9 #include <boost/fusion/include/vector.hpp>
12 namespace fusion
= boost::fusion
;
13 namespace hana
= boost::hana
;
17 // In the old code, this used to receive a Fusion sequence.
18 // Now, it can be either a Hana sequence or a Fusion sequence.
19 template <typename Sequence
>
20 void f(Sequence
const& seq
) {
21 hana::for_each(seq
, [](auto const& element
) {
22 std::cout
<< element
<< std::endl
;
29 f(hana::make_tuple(1, 2, 3));
30 f(fusion::make_vector(1, 2, 3));