Skip to content

<ranges>: Temporarily disable join_view for non-forward_ranges, pending resolution of LWG-3698 - #2727

Merged
Stephan T. Lavavej (StephanTLavavej) merged 4 commits into
microsoft:mainfrom
cpplearner:jv
May 24, 2022
Merged

Conversation

@cpplearner

Copy link
Copy Markdown
Contributor

As pointed out in LWG-3698, join_view is currently broken for "stashing iterators" (iterators that return a reference to a member object). The issue mentions that join_view would need to store the outer iterator in a non-propagating-cache for input ranges.

The fix might change the layout of join_view (and of its iterator type, if we don't want to store a redundant outer iterator). So I believe that it is useful to flag the affected uses of join_view.

This requires users to define a macro if they don't depend on the ABI of join_view and want to use join_view for input ranges. I hope it's not too much of a problem.

@cpplearner
S. B. Tam (cpplearner) requested a review from a team as a code owner May 17, 2022 10:45
Comment thread stl/inc/ranges Outdated
@cpplearner

Copy link
Copy Markdown
Contributor Author

FYI here's what I think the fix would roughly look like: https://github.com/cpplearner/STL/tree/lwg3698.

@StephanTLavavej

Copy link
Copy Markdown
Member

I'm speculatively mirroring this to the MSVC-internal repo - further changes can be pushed, but please notify me.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm applying a clarification to the error message to make the consequences of overriding clear.

Comment thread stl/inc/ranges Outdated
@CaseyCarter Casey Carter (CaseyCarter) removed their assignment May 22, 2022
Comment thread stl/inc/ranges Outdated
…oroughly.

Co-authored-by: timsong-cpp <rs2740@gmail.com>
@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit 2966813 into microsoft:main May 24, 2022
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for noticing this issue and preventing users from being bitten by it! 🐍 🦇 🧛

Igor Zhukov (fsb4000) pushed a commit to fsb4000/STL that referenced this pull request Aug 13, 2022
… pending resolution of LWG-3698 (microsoft#2727)

Co-authored-by: Casey Carter <cartec69@gmail.com>
Co-authored-by: timsong-cpp <rs2740@gmail.com>
S. B. Tam (cpplearner) added a commit to cpplearner/STL that referenced this pull request Feb 14, 2023
…range`s, pending resolution of LWG-3698 (microsoft#2727)"

This reverts commit 2966813.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ranges C++20/23 ranges

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants