tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
partition_point.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_ALGORITHM_PARTITION_POINT_HPP
4#define TETL_ALGORITHM_PARTITION_POINT_HPP
5
6namespace etl {
7
12template <typename ForwardIt, typename Predicate>
13[[nodiscard]] constexpr auto partition_point(ForwardIt first, ForwardIt last, Predicate p) -> ForwardIt
14{
15 for (; first != last; ++first) {
16 if (not p(*first)) {
17 break;
18 }
19 }
20
21 return first;
22}
23
24} // namespace etl
25
26#endif // TETL_ALGORITHM_PARTITION_POINT_HPP
constexpr auto partition_point(ForwardIt first, ForwardIt last, Predicate p) -> ForwardIt
Examines the partitioned (as if by partition) range [first, last) and locates the end of the first pa...
Definition partition_point.hpp:13
Definition adjacent_find.hpp:8