tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
fill.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2019 Tobias Hienzsch
3
4#ifndef TETL_ALGORITHM_FILL_HPP
5#define TETL_ALGORITHM_FILL_HPP
6
7namespace etl {
8
9/// \brief Assigns the given value to the elements in the range `[first, last)`.
10/// \ingroup algorithm
11template <typename ForwardIt, typename T>
12constexpr auto fill(ForwardIt first, ForwardIt last, T const& value) -> void
13{
14 for (; first != last; ++first) {
15 *first = value;
16 }
17}
18
19} // namespace etl
20
21#endif // TETL_ALGORITHM_FILL_HPP
constexpr auto fill(ForwardIt first, ForwardIt last, T const &value) -> void
Assigns the given value to the elements in the range [first, last).
Definition fill.hpp:12
Definition adjacent_find.hpp:9