Skip to content

[Alberto Icardi]- Algorithms task 5#547

Open
AlbertoIcardi97 wants to merge 2 commits intosmay1613:masterfrom
AlbertoIcardi97:algorithms_task_5_Icardi
Open

[Alberto Icardi]- Algorithms task 5#547
AlbertoIcardi97 wants to merge 2 commits intosmay1613:masterfrom
AlbertoIcardi97:algorithms_task_5_Icardi

Conversation

@AlbertoIcardi97
Copy link

No description provided.

template <typename BiIt, typename UnaryPredicate>
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 first = std::partition(begin, position, [&predicate](typename BiIt::value_type value) { return !predicate(value); });
Copy link
Owner

Choose a reason for hiding this comment

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

don't copy the values, use const reference

@smay1613 smay1613 added nice_work Everything is good :) second_review and removed first_review labels Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nice_work Everything is good :) second_review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants