]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/benchmark/transform/execute.hana.tuple.erb.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / hana / benchmark / transform / execute.hana.tuple.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 #include <boost/hana/transform.hpp>
6 #include <boost/hana/tuple.hpp>
7
8 #include "measure.hpp"
9 #include <cstdlib>
10
11
12 int main () {
13 boost::hana::benchmark::measure([] {
14 long long result = 0;
15 for (int iteration = 0; iteration < 1 << 10; ++iteration) {
16 auto values = boost::hana::make_tuple(
17 <%= input_size.times.map { 'std::rand()' }.join(', ') %>
18 );
19
20 auto transformed = boost::hana::transform(values, [&](auto t) {
21 return result += t;
22 });
23 (void)transformed;
24 }
25 });
26 }