]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/benchmark/transform/compile.fusion.vector.erb.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / hana / benchmark / transform / compile.fusion.vector.erb.cpp
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)
4
5 <% if input_size > 10 %>
6 #define FUSION_MAX_VECTOR_SIZE <%= ((input_size + 9) / 10) * 10 %>
7 <% end %>
8
9 #include <boost/fusion/include/as_vector.hpp>
10 #include <boost/fusion/include/make_vector.hpp>
11 #include <boost/fusion/include/transform.hpp>
12 namespace fusion = boost::fusion;
13
14
15 struct f {
16 template <typename X>
17 constexpr X operator()(X x) const { return x; }
18 };
19
20 template <int i>
21 struct x { };
22
23 int main() {
24 auto xs = fusion::make_vector(
25 <%= (1..input_size).map { |n| "x<#{n}>{}" }.join(', ') %>
26 );
27
28 auto result = fusion::as_vector(fusion::transform(xs, f{}));
29 (void)result;
30 }