tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
remove_copy_if.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_ALGORITHM_REMOVE_COPY_IF_HPP
4#define TETL_ALGORITHM_REMOVE_COPY_IF_HPP
5
6namespace etl {
7
14template <typename InputIt, typename OutputIt, typename Predicate>
15constexpr auto remove_copy_if(InputIt first, InputIt last, OutputIt destination, Predicate p) -> OutputIt
16{
17 for (; first != last; ++first, (void)++destination) {
18 if (not p(*first)) {
19 *destination = *first;
20 }
21 }
22
23 return destination;
24}
25
26} // namespace etl
27
28#endif // TETL_ALGORITHM_REMOVE_COPY_IF_HPP
constexpr auto remove_copy_if(InputIt first, InputIt last, OutputIt destination, Predicate p) -> OutputIt
Copies elements from the range [first, last), to another range beginning at destination,...
Definition remove_copy_if.hpp:15
Definition adjacent_find.hpp:8