tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
fill_n.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_ALGORITHM_FILL_N_HPP
4#define TETL_ALGORITHM_FILL_N_HPP
5
6namespace etl {
7
15template <typename OutputIt, typename Size, typename T>
16constexpr auto fill_n(OutputIt first, Size count, T const& value) -> OutputIt
17{
18 for (auto i = Size{0}; i < count; ++i) {
19 *first = value;
20 ++first;
21 }
22 return first;
23}
24
25} // namespace etl
26
27#endif // TETL_ALGORITHM_FILL_N_HPP
constexpr auto count(InputIt first, InputIt last, T const &value) -> typename iterator_traits< InputIt >::difference_type
Returns the number of elements in the range [first, last) satisfying specific criteria....
Definition count.hpp:21
constexpr auto fill_n(OutputIt first, Size count, T const &value) -> OutputIt
Assigns the given value to the first count elements in the range beginning at first if count > 0....
Definition fill_n.hpp:16
Definition adjacent_find.hpp:8