Skip to content

Conversation

miscco
Copy link
Contributor

@miscco miscco commented Jul 14, 2021

I did not add new test yet, will audit them

Fixes #1684.

@miscco miscco requested a review from a team as a code owner July 14, 2021 11:16
@StephanTLavavej StephanTLavavej changed the title Implement rest of P2259 Implement rest of P2259R1, Repairing Input Range Adaptors Jul 14, 2021
@StephanTLavavej StephanTLavavej added LWG Library Working Group issue ranges C++20/23 ranges labels Jul 14, 2021
@CaseyCarter CaseyCarter self-assigned this Jul 14, 2021
@@ -4020,18 +4018,20 @@ namespace ranges {
template <bool _Const>
class _Sentinel;

template <class _Traits> // TRANSITION, LWG-3289
template <class _Base>
Copy link
Contributor

Choose a reason for hiding this comment

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

Note to other reviewers: we already implement the equivalent of the split_view changes from P2259R1.

#ifdef __cpp_lib_concepts
using reference = iter_rvalue_reference_t<_Iter>;
using iterator_concept = input_iterator_tag;
using reference = iter_rvalue_reference_t<_Iter>;
#else // ^^^ __cpp_lib_concepts / !__cpp_lib_concepts vvv
using reference =
conditional_t<is_reference_v<_Iter_ref_t<_Iter>>, remove_reference_t<_Iter_ref_t<_Iter>>&&, _Iter_ref_t<_Iter>>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Note to reviewers: #1939 already implemented the counted_iterator changes from P2259R1.

@CaseyCarter CaseyCarter removed their assignment Aug 3, 2021
CaseyCarter and others added 4 commits August 5, 2021 12:22
... which has been resolved as NAD after adoption of P2259.

Drive-by: Correctly order the `iterator_traits` nested types in three places where they are misordered. (There's some value in using the Standard's consistent ordering.)
... by adding constructors and giving up on the code generation benefits of being ABI-aggregate. Adding a defaulted `<=>` to the partial specializations of the base class `_Ioterator_category_base` allows us to go back to defaulting `==` and `<=>`.
@CaseyCarter CaseyCarter self-requested a review August 12, 2021 20:33
... that I made redundant in the last commit.
@CaseyCarter CaseyCarter removed their assignment Aug 12, 2021
@StephanTLavavej StephanTLavavej self-assigned this Aug 14, 2021
@StephanTLavavej
Copy link
Member

I'm mirroring this to an MSVC-internal PR. Please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 6342084 into microsoft:main Aug 17, 2021
@StephanTLavavej
Copy link
Member

Thanks for implementing these repairs for broken Standardese! 🏚️ 🛠️ 🏡

@miscco miscco deleted the P2259-iterator-fixes branch August 21, 2021 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LWG Library Working Group issue ranges C++20/23 ranges
Projects
None yet
Development

Successfully merging this pull request may close these issues.

P2259R1 Repairing Input Range Adaptors And counted_iterator
5 participants