]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/example/zip_with.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/equal.hpp>
6 #include <boost/hana/ext/std/tuple.hpp>
7 #include <boost/hana/mult.hpp>
8 #include <boost/hana/transform.hpp>
9 #include <boost/hana/tuple.hpp>
10 #include <boost/hana/type.hpp>
11 #include <boost/hana/unpack.hpp>
12 #include <boost/hana/zip_with.hpp>
15 #include <type_traits>
17 namespace hana
= boost::hana
;
22 hana::zip_with(hana::mult
, hana::make_tuple(1, 2, 3, 4), hana::make_tuple(5, 6, 7, 8))
24 hana::make_tuple(5, 12, 21, 32)
29 // Example of computing a tuple of all the common types of several tuples:
30 template<typename
... Ts
>
31 using common_tuple_t
= typename
decltype(
34 hana::metafunction
<std::common_type
>,
35 hana::transform(std::declval
<Ts
>(), hana::decltype_
)...
37 hana::template_
<std::tuple
>
42 static_assert(std::is_same
<
44 std::tuple
<bool, int, unsigned>,
45 std::tuple
<char, long, long>,
46 std::tuple
<int, long long, double>
48 std::tuple
<int, long long, double>