Skip to content

[Iulia Corici] algorithms_task_5#539

Open
icorici wants to merge 1 commit intosmay1613:masterfrom
icorici:algorithms_task5_IuliaCorici
Open

[Iulia Corici] algorithms_task_5#539
icorici wants to merge 1 commit intosmay1613:masterfrom
icorici:algorithms_task5_IuliaCorici

Conversation

@icorici
Copy link

@icorici icorici commented Feb 21, 2023

No description provided.

std::pair<BiIt, BiIt> gather(BiIt begin, BiIt end, BiIt position, UnaryPredicate predicate);
std::pair<BiIt, BiIt> gather(BiIt begin, BiIt end, BiIt position, UnaryPredicate predicate) {
auto invertedPredicate =
[&predicate](typename std::iterator_traits<BiIt>::value_type val) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't copy, use reference

return !predicate(val);
};

auto partitionStart = std::partition(begin, position, invertedPredicate);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stable_partition?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants