Skip to content

Add unwrapping to move_sentinel - #3098

Merged
Stephan T. Lavavej (StephanTLavavej) merged 4 commits into
microsoft:mainfrom
strega-nil:unwrap-move_sentinel
Sep 13, 2022
Merged

Add unwrapping to move_sentinel#3098
Stephan T. Lavavej (StephanTLavavej) merged 4 commits into
microsoft:mainfrom
strega-nil:unwrap-move_sentinel

Conversation

@strega-nil-ms

Copy link
Copy Markdown
Contributor

fixes #3009

There are two new concepts - _Weakly_unwrappable_sentinel and _Weakly_unwrappable_iterator - these are useful for implementation of wrapper types which are unwrappable when their underlying type is unwrappable (like move_iterator/move_sentinel)

@strega-nil-ms nicole mazzuca (strega-nil-ms) added enhancement Something can be improved performance Must go faster ranges C++20/23 ranges labels Sep 12, 2022
@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) removed the enhancement Something can be improved label Sep 12, 2022
@StephanTLavavej

Copy link
Copy Markdown
Member

Adjusting labels - we usually use enhancement only when no more specific label like performance applies.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! Looks good, all I found were 3 tiny nitpicks, and IIRC you also prefer brace construction when possible, so I'll validate and push changes to save time. (I'd request changes if I were less sure you'd prefer them.)

Comment thread stl/inc/iterator Outdated
Comment thread stl/inc/iterator Outdated
@StephanTLavavej

Copy link
Copy Markdown
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit ac129e5 into microsoft:main Sep 13, 2022
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for this ranges performance improvement! πŸš€ πŸŽ‰ 😻 🎁

Casey Carter (CaseyCarter) pushed a commit to CaseyCarter/STL that referenced this pull request Oct 6, 2022
Co-authored-by: Nicole Mazzuca <mazzucan@outlook.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
@strega-nil-ms
nicole mazzuca (strega-nil-ms) deleted the unwrap-move_sentinel branch December 19, 2022 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Must go faster ranges C++20/23 ranges

Projects

None yet

Development

Successfully merging this pull request may close these issues.

<iterator>: move_sentinel could be unwrappable

4 participants