tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
all_of.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_ALGORITHM_ALL_OF_HPP
4#define TETL_ALGORITHM_ALL_OF_HPP
5
7
8namespace etl {
9
12
14template <typename InputIt, typename Predicate>
15[[nodiscard]] constexpr auto all_of(InputIt first, InputIt last, Predicate p) -> bool
16{
17 return etl::find_if_not(first, last, p) == last;
18}
19
21
22} // namespace etl
23
24#endif // TETL_ALGORITHM_ALL_OF_HPP
constexpr auto all_of(InputIt first, InputIt last, Predicate p) -> bool
Checks if unary predicate p returns true for all elements in the range [first, last).
Definition all_of.hpp:15
constexpr auto find_if_not(InputIt first, InputIt last, Predicate pred) noexcept -> InputIt
Searches for an element for which predicate q returns false.
Definition find_if_not.hpp:18
Definition adjacent_find.hpp:8