Skip to content

Implement LWG-3724: decay-copy should be constrained - #2903

Merged
Stephan T. Lavavej (StephanTLavavej) merged 5 commits into
microsoft:mainfrom
frederick-vs-ja:lwg-3724
Jul 28, 2022
Merged

Stephan T. Lavavej (StephanTLavavej) merged 5 commits into
microsoft:mainfrom
frederick-vs-ja:lwg-3724

Conversation

@frederick-vs-ja

Copy link
Copy Markdown
Contributor

Towards #2872.

Only one case in the operator() of _All_fn (the type of views::all) needs additional constraints. MSVC STL has already constrained it with constructible_from, but sometimes constructible_from seems still insufficient.

I'm not sure whether the difference between constructible_from and convertible_to is observable outside of IFNDR, or whether weird_string_view in the test file actually models view.

@frederick-vs-ja
A. Jiang (frederick-vs-ja) requested a review from a team as a code owner July 24, 2022 15:13
@CaseyCarter Casey Carter (CaseyCarter) added LWG Library Working Group issue blocked Something is preventing work on this labels Jul 25, 2022
unsigned int size_ = 0u;

weird_string_view() = default;
explicit weird_string_view(const weird_string_view&) = default;

@CaseyCarter Casey Carter (CaseyCarter) Jul 25, 2022

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.

copy_constructible requires implicit copy construction via convertible_to<const T&, T>, so this is a move-only view. (No change requested.)

Comment thread stl/inc/ranges
Comment thread tests/std/tests/P0896R4_views_all/test.cpp
@CaseyCarter Casey Carter (CaseyCarter) removed the blocked Something is preventing work on this label Jul 25, 2022
@CaseyCarter Casey Carter (CaseyCarter) added the ranges C++20/23 ranges label Jul 26, 2022
@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 9aff8c5 into microsoft:main Jul 28, 2022
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for implementing so many LWG issue resolutions and improving conformance! 😻 😻 😻 😻

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.

3 participants