tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
for_each.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_ALGORITHM_FOR_EACH_HPP
4#define TETL_ALGORITHM_FOR_EACH_HPP
5
6namespace etl {
7
19template <typename InputIt, typename UnaryFunc>
20constexpr auto for_each(InputIt first, InputIt last, UnaryFunc f) noexcept -> UnaryFunc
21{
22 for (; first != last; ++first) {
23 f(*first);
24 }
25 return f;
26}
27
28} // namespace etl
29
30#endif // TETL_ALGORITHM_FOR_EACH_HPP
constexpr auto for_each(InputIt first, InputIt last, UnaryFunc f) noexcept -> UnaryFunc
Applies the given function object f to the result of dereferencing every iterator in the range [first...
Definition for_each.hpp:20
Definition adjacent_find.hpp:8