tetl
0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
find_if.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSL-1.0
2
3
#ifndef TETL_ALGORITHM_FIND_IF_HPP
4
#define TETL_ALGORITHM_FIND_IF_HPP
5
6
namespace
etl
{
7
17
template
<
typename
InputIt,
typename
Predicate>
18
[[nodiscard]]
constexpr
auto
find_if
(InputIt first, InputIt last, Predicate pred)
noexcept
-> InputIt
19
{
20
for
(; first != last; ++first) {
21
if
(pred(*first)) {
22
return
first;
23
}
24
}
25
return
last;
26
}
27
28
}
// namespace etl
29
30
#endif
// TETL_ALGORITHM_FIND_IF_HPP
etl::find_if
constexpr auto find_if(InputIt first, InputIt last, Predicate pred) noexcept -> InputIt
Searches for an element for which predicate p returns true.
Definition
find_if.hpp:18
etl
Definition
adjacent_find.hpp:8
include
etl
_algorithm
find_if.hpp
Generated on Sat Mar 8 2025 16:19:59 for tetl by
1.14.0