Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Iulia Corici] algorithms_task_5 #539

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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