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 views::all and views::reverse #1229

Merged
merged 11 commits into from
Sep 1, 2020

Conversation

CaseyCarter
Copy link
Member

Also, perma-workaround LLVM-37556 by pulling the _Cpos namespace into std with a using-directive rather than making it an inline namespace.

There are some related changes to view_interface in <xutility> and _String_view_iterator in <xstring> to silence warnings about comparing integer types of different signed-ness.

There are also changes to enable test::range to model view for use in testing range adaptors.

Partially addresses #39.

Also, perma-workaround LLVM-37556.
@CaseyCarter CaseyCarter added cxx20 C++20 feature ranges C++20/23 ranges labels Aug 24, 2020
@CaseyCarter CaseyCarter requested a review from a team as a code owner August 24, 2020 20:37
... of the `CanBegin` etc. concepts now centralized in `<range_algorithm_support.hpp>`.
STATIC_ASSERT(!CanBack<V const>);
STATIC_ASSERT(!CanIndex<V>);
STATIC_ASSERT(!CanIndex<V const>);
STATIC_ASSERT(!CanEmpty<V&>);
Copy link
Member Author

@CaseyCarter CaseyCarter Aug 25, 2020

Choose a reason for hiding this comment

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

Sorry for this enormous set of mechanical changes. This is s/CanFront/CanMemberFront/g, s/CanBack/CanMemberBack/g, and tacking & onto every type argument. The "old" concepts in this file didn't care about value category - they forced all type parameters to lvalues - but the "new" concepts in <range_algorithms_support.hpp> do.

stl/inc/ranges Outdated Show resolved Hide resolved
stl/inc/ranges Show resolved Hide resolved
stl/inc/ranges Outdated Show resolved Hide resolved
stl/inc/ranges Show resolved Hide resolved
stl/inc/ranges Show resolved Hide resolved
stl/inc/xutility Outdated Show resolved Hide resolved
Copy link
Contributor

@miscco miscco left a comment

Choose a reason for hiding this comment

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

This is some super impressive engineering here. 👍

CaseyCarter and others added 4 commits August 25, 2020 08:22
From miscco.

Co-authored-by: Michael Schellenberger Costa <mschellenbergercosta@gmail.com>
... which are a complicated spelling of `true`.
stl/inc/ranges Show resolved Hide resolved
@CaseyCarter CaseyCarter mentioned this pull request Aug 25, 2020
@StephanTLavavej StephanTLavavej changed the title Implement views:all and views::reverse Implement views::all and views::reverse Aug 26, 2020
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 to me, some comments but nothing blocking.

stl/inc/ranges Outdated Show resolved Hide resolved
stl/inc/ranges Outdated Show resolved Hide resolved
stl/inc/ranges Outdated Show resolved Hide resolved
stl/inc/ranges Show resolved Hide resolved
stl/inc/ranges Show resolved Hide resolved
@StephanTLavavej StephanTLavavej removed their assignment Aug 29, 2020
stl/inc/ranges Outdated Show resolved Hide resolved
@CaseyCarter CaseyCarter self-assigned this Aug 31, 2020
@CaseyCarter CaseyCarter merged commit e652e72 into microsoft:master Sep 1, 2020
@CaseyCarter CaseyCarter deleted the all_reverse branch September 1, 2020 04:07
@CaseyCarter
Copy link
Member Author

Thanks for contributing two range adaptors which are their own inverses!

@CaseyCarter CaseyCarter removed their assignment Sep 1, 2020
fengjixuchui added a commit to fengjixuchui/STL that referenced this pull request Sep 1, 2020
Implement views::all and views::reverse (microsoft#1229)
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