tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
iota.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2019 Tobias Hienzsch
3#ifndef TETL_NUMERIC_IOTA_HPP
4#define TETL_NUMERIC_IOTA_HPP
5
6#include <etl/_limits/numeric_limits.hpp>
7
8namespace etl {
9
10/// \brief Fills the range [first, last) with sequentially increasing values,
11/// starting with value and repetitively evaluating ++value.
12/// \ingroup numeric
13template <typename ForwardIt, typename T>
14constexpr auto iota(ForwardIt first, ForwardIt last, T value) -> void
15{
16 while (first != last) {
17 *first++ = value;
18 ++value;
19 }
20}
21} // namespace etl
22
23#endif // TETL_NUMERIC_IOTA_HPP
constexpr auto iota(ForwardIt first, ForwardIt last, T value) -> void
Fills the range [first, last) with sequentially increasing values, starting with value and repetitive...
Definition iota.hpp:14
Definition adjacent_find.hpp:9