tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
find.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_ALGORITHM_FIND_HPP
4#define TETL_ALGORITHM_FIND_HPP
5
6namespace etl {
7
17template <typename InputIt, typename T>
18[[nodiscard]] constexpr auto find(InputIt first, InputIt last, T const& value) noexcept -> InputIt
19{
20 for (; first != last; ++first) {
21 if (*first == value) {
22 return first;
23 }
24 }
25 return last;
26}
27
28} // namespace etl
29
30#endif // TETL_ALGORITHM_FIND_HPP
constexpr auto find(InputIt first, InputIt last, T const &value) noexcept -> InputIt
Searches for an element equal to value.
Definition find.hpp:18
Definition adjacent_find.hpp:8