tetl
0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
generate.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSL-1.0
2
3
#ifndef TETL_ALGORITHM_GENERATE_HPP
4
#define TETL_ALGORITHM_GENERATE_HPP
5
6
namespace
etl
{
7
18
template
<
typename
ForwardIt,
typename
Generator>
19
constexpr
auto
generate
(ForwardIt first, ForwardIt last, Generator g) ->
void
20
{
21
for
(; first != last; ++first) {
22
*first = g();
23
}
24
}
25
26
}
// namespace etl
27
28
#endif
// TETL_ALGORITHM_GENERATE_HPP
etl::generate
constexpr auto generate(ForwardIt first, ForwardIt last, Generator g) -> void
Assigns each element in range [first, last) a value generated by the given function object g.
Definition
generate.hpp:19
etl
Definition
adjacent_find.hpp:8
include
etl
_algorithm
generate.hpp
Generated on Sat Mar 8 2025 16:19:59 for tetl by
1.14.0