tetl
0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
for_each_n.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSL-1.0
2
3
#ifndef TETL_ALGORITHM_FOR_EACH_N_HPP
4
#define TETL_ALGORITHM_FOR_EACH_N_HPP
5
6
namespace
etl
{
7
19
template
<
typename
InputIt,
typename
Size,
typename
UnaryFunc>
20
constexpr
auto
for_each_n
(InputIt first, Size n, UnaryFunc f)
noexcept
-> InputIt
21
{
22
for
(Size i = 0; i < n; ++first, (void)++i) {
23
f(*first);
24
}
25
return
first;
26
}
27
28
}
// namespace etl
29
30
#endif
// TETL_ALGORITHM_FOR_EACH_N_HPP
etl::for_each_n
constexpr auto for_each_n(InputIt first, Size n, UnaryFunc f) noexcept -> InputIt
Applies the given function object f to the result of dereferencing every iterator in the range [first...
Definition
for_each_n.hpp:20
etl
Definition
adjacent_find.hpp:8
include
etl
_algorithm
for_each_n.hpp
Generated on Sat Mar 8 2025 16:19:59 for tetl by
1.14.0