]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/hana/benchmark/find_if/compile.hana.tuple.erb.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / hana / benchmark / find_if / compile.hana.tuple.erb.cpp
CommitLineData
b32b8144 1// Copyright Louis Dionne 2013-2017
7c673cae
FG
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/bool.hpp>
6#include <boost/hana/find_if.hpp>
7#include <boost/hana/integral_constant.hpp>
8#include <boost/hana/tuple.hpp>
9
10
11struct is_last {
12 template <typename N>
13 constexpr auto operator()(N) const {
14 return boost::hana::bool_c<N::value == <%= input_size %>>;
15 }
16};
17
18int main() {
19 constexpr auto tuple = boost::hana::make_tuple(
20 <%= (1..input_size).map { |n| "boost::hana::int_c<#{n}>" }.join(', ') %>
21 );
22 constexpr auto result = boost::hana::find_if(tuple, is_last{});
23 (void)result;
24}