Skip to content

: improve views::istream constraints - #3335

Merged
Stephan T. Lavavej (StephanTLavavej) merged 1 commit into
microsoft:mainfrom
CaseyCarter:istream-SFINAE
Jan 12, 2023
Merged

Stephan T. Lavavej (StephanTLavavej) merged 1 commit into
microsoft:mainfrom
CaseyCarter:istream-SFINAE

Conversation

@CaseyCarter

Copy link
Copy Markdown
Contributor

views::istream::operator() currently emits "hard" errors when its argument is correctly derived_from a specialization of basic_istream but any of the other requirements isn't satisfied. This is non-conforming, since the CPO wording requires CPOs not to participate in overload resolution for sets of arguments that don't meet the CPOs requirements.

Let's flesh out the constraints, and add some negative test cases to ensure we get SFINAE instead of hard errors.

`views::istream::operator()` currently emits "hard" errors when its argument is correctly `derived_from` a specialization of `basic_istream` but any of the other requirements isn't satisfied. This is non-conforming, since the CPO wording requires CPOs not to participate in overload resolution for sets of arguments that don't meet the CPOs requirements.

Let's flesh out the constraints, and add some negative test cases to ensure we get SFINAE instead of hard errors.
@CaseyCarter Casey Carter (CaseyCarter) added bug Something isn't working ranges C++20/23 ranges labels Jan 9, 2023
@CaseyCarter
Casey Carter (CaseyCarter) requested a review from a team as a code owner January 9, 2023 10:04
@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 7d58e57 into microsoft:main Jan 12, 2023
@CaseyCarter
Casey Carter (CaseyCarter) deleted the istream-SFINAE branch January 12, 2023 02:29
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for improving views::🍨! 😹 🎉 🤪

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

Labels

bug Something isn't working ranges C++20/23 ranges

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants