tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
none_of.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2019 Tobias Hienzsch
3
4#ifndef TETL_ALGORITHM_NONE_OF_HPP
5#define TETL_ALGORITHM_NONE_OF_HPP
6
7#include <etl/_algorithm/find_if.hpp>
8
9namespace etl {
10
11/// \brief Checks if unary predicate p returns true for no elements in the range `[first, last)`.
12/// \ingroup algorithm
13template <typename InputIt, typename Predicate>
14[[nodiscard]] constexpr auto none_of(InputIt first, InputIt last, Predicate p) -> bool
15{
16 return etl::find_if(first, last, p) == last;
17}
18
19} // namespace etl
20
21#endif // TETL_ALGORITHM_NONE_OF_HPP
constexpr auto none_of(InputIt first, InputIt last, Predicate p) -> bool
Checks if unary predicate p returns true for no elements in the range [first, last).
Definition none_of.hpp:14
Definition adjacent_find.hpp:9