Skip to content

Implement LWG-3743 ranges::to's reserve may be ill-formed - #3269

Merged
Stephan T. Lavavej (StephanTLavavej) merged 8 commits into
microsoft:mainfrom
fsb4000:fix3224
Dec 15, 2022
Merged

Stephan T. Lavavej (StephanTLavavej) merged 8 commits into
microsoft:mainfrom
fsb4000:fix3224

Conversation

@fsb4000

Copy link
Copy Markdown
Contributor

Fixes #3224

@fsb4000
Igor Zhukov (fsb4000) requested a review from a team as a code owner December 6, 2022 16:51
@CaseyCarter Casey Carter (CaseyCarter) added the LWG Library Working Group issue label Dec 6, 2022
@fsb4000

Igor Zhukov (fsb4000) commented Dec 6, 2022

Copy link
Copy Markdown
Contributor Author
// LWG example
auto r = std::ranges::subrange(std::views::iota(0ULL) | std::views::take(5), 5);
auto v = r | std::ranges::to<std::vector<std::size_t>>(0);

The LWG example gives me a mixed signed/unsigned warning and I changed 0 to 0ULL without having a full understanding of where it is used and I only tested X86-64

Comment thread tests/std/tests/P1206R7_vector_from_range/test.cpp Outdated
Comment thread tests/std/tests/P1206R7_vector_from_range/test.cpp Outdated
Comment thread stl/inc/xutility
Comment thread tests/std/tests/P1206R7_vector_from_range/test.cpp Outdated

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.

Thanks so much!

@strega-nil-ms

nicole mazzuca (strega-nil-ms) commented Dec 7, 2022

Copy link
Copy Markdown
Contributor

Casey Carter (@CaseyCarter) changes have been pushed to add a TRANSITION comment and resolve your comments if you would like to re-review.

Comment thread stl/inc/xutility Outdated
@StephanTLavavej

Copy link
Copy Markdown
Member

nicole mazzuca (@strega-nil-ms) Casey Carter (@CaseyCarter) I pushed a change to fix damaged bug number citations.

@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 a66a092 into microsoft:main Dec 15, 2022
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for implementing this LWG issue resolution - well-formed code is so much nicer than ill-formed! 😹 🛠️ 🎉

@fsb4000
Igor Zhukov (fsb4000) deleted the fix3224 branch December 15, 2022 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LWG Library Working Group issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LWG-3743 ranges::to's reserve may be ill-formed

4 participants