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

Implement Ranges Set Operations #1044

Merged
merged 5 commits into from
Jul 28, 2020
Merged

Conversation

CaseyCarter
Copy link
Member

  • mergeable concept

  • algorithms: ranges::includes, ranges::set_union, ranges::set_intersection, ranges::set_difference, and ranges::set_symmetric_difference.

Partially addresses #39.

* `mergeable` concept

* algorithms: `ranges::includes`, `ranges::set_union`, `ranges::set_intersection`, `ranges::set_difference`, and `ranges::set_symmetric_difference`.
@CaseyCarter CaseyCarter added the cxx20 C++20 feature label Jul 14, 2020
@CaseyCarter CaseyCarter requested a review from a team as a code owner July 14, 2020 19:00
@CaseyCarter CaseyCarter mentioned this pull request Jul 14, 2020
stl/inc/algorithm Outdated Show resolved Hide resolved
tests/std/tests/P0896R4_ranges_alg_includes/test.cpp Outdated Show resolved Hide resolved
_Get_unwrapped(_STD move(_Last1)), _Get_unwrapped(_STD move(_First2)),
_Get_unwrapped(_STD move(_Last2)), _Get_unwrapped_unverified(_STD move(_Result)), _Pass_fn(_Pred),
_Pass_fn(_Proj1), _Pass_fn(_Proj2));
_Seek_wrapped(_First1, _STD move(_UResult.in1));
Copy link
Contributor

Choose a reason for hiding this comment

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

I am wondering whether this one would be helpful (If yes than it is future work. No change requested):

template<class _It1, class _It2, class _Out, class _UIt1, class _UIt2, class _UOut>
in_in_out_result<_It1, _It2, _Out> _Seek_wrapped(_It1& _In1, _It2& _In2, _UOut& _Out, in_in_out_result<_UIt1, _UIt2, _UOut>&& _UResult);

Same for in_out_result and in_in_result which occur often enough that it makes sense

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably so. I think we should add a work item to scan through the unwrapping and rewrapping to find opportunities for simplification after/in conjunction with the pass to unwrap result iterators with _Get_unwrapped_n.

Copy link
Member

@StephanTLavavej StephanTLavavej left a comment

Choose a reason for hiding this comment

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

Looks good, very small suggestions.

stl/inc/algorithm Outdated Show resolved Hide resolved
stl/inc/algorithm Outdated Show resolved Hide resolved
stl/inc/algorithm Outdated Show resolved Hide resolved
@StephanTLavavej StephanTLavavej added the ranges C++20/23 ranges label Jul 15, 2020
stl/inc/algorithm Show resolved Hide resolved
@CaseyCarter CaseyCarter self-assigned this Jul 28, 2020
@CaseyCarter CaseyCarter merged commit 3659f3d into microsoft:master Jul 28, 2020
@CaseyCarter CaseyCarter deleted the setops branch July 28, 2020 22:26
@CaseyCarter
Copy link
Member Author

I'm having trouble coming up with a witty comment here... perhaps a limerick? What rhymes with set_symmetric_difference?

@CaseyCarter CaseyCarter removed their assignment Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cxx20 C++20 feature ranges C++20/23 ranges
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants