Skip to content

Conversation

@StephanTLavavej
Copy link
Member

Fixes #538 by completing LWG-1203 "More useful rvalue stream insertion".

We had already implemented most of this LWG issue resolution, so only the constraints needed to be adjusted. Replacing is_base_of<ios_base, Stream> with is_convertible<Stream*, ios_base*> implements the "publicly and unambiguously derived" wording in WG21-N4861 [istream.rvalue]/1 and [ostream.rvalue]/1 thanks to [conv.ptr]/3. As a bonus, it also allows us to remove the "avoid infinite recursion" constraint negation<is_lvalue_reference<Stream>>, because attempting to form a pointer to a reference will SFINAE due to [dcl.ptr]/4 and [dcl.ref]/5.

Finally, I crafted a test that fails without this change and passes with it.

@StephanTLavavej StephanTLavavej added the LWG Library Working Group issue label Aug 23, 2020
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner August 23, 2020 02:21
@StephanTLavavej StephanTLavavej self-assigned this Aug 26, 2020
@StephanTLavavej StephanTLavavej merged commit ab6cbd3 into microsoft:master Aug 26, 2020
@StephanTLavavej StephanTLavavej deleted the lwg1203 branch August 26, 2020 07:51
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-1203 More useful rvalue stream insertion

3 participants