]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/hana/benchmark/find_if/compile.std.integer_sequence.erb.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / hana / benchmark / find_if / compile.std.integer_sequence.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/ext/std/integer_sequence.hpp>
7#include <boost/hana/find_if.hpp>
8#include <boost/hana/integral_constant.hpp>
9
10#include <utility>
11namespace hana = boost::hana;
12
13
14struct is_last {
15 template <typename N>
16 constexpr auto operator()(N) const {
17 return hana::bool_c<N::value == <%= input_size %>>;
18 }
19};
20
21int main() {
22 auto sequence = std::integer_sequence<
23 <%= (["int"] + (1..input_size).to_a).join(', ') %>
24 >{};
25 auto result = hana::find_if(sequence, is_last{});
26 (void)result;
27}