Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ostream.manip] Introduce SYNCBUF to detect basic_syncbuf LWG 3501 #4300

Closed
wants to merge 1 commit into from

Conversation

jwakely
Copy link
Member

@jwakely jwakely commented Oct 20, 2020

This attempts to address the problem of Allocator being mentioned in
the function descriptions without being defined. We cannot say that

os.rdbuf() is a basic_syncbuf<charT, traits, Allocator>*

because firstly, that type is not defined, and secondly os.rdbuf() is
a basic_streambuf<charT, traits>* and not any other type.

By introducing SYNCBUF we can define the manipulators properly, by
talking about a base class subobject rather than "is a".

This introduces an apparently normative change that the syncbuf type
must not use a program-defined specialization. Without that additional
restriction the implementation suggested by the note doesn't work,
because program-defined specializations cannot derive from the
intermediate base class, and therefore cannot be detected by SYNCBUF.

@jwakely
Copy link
Member Author

jwakely commented Oct 20, 2020

CI fails because of overfull hboxes

Screenshot_20201020_135518

@jensmaurer
Copy link
Member

Say "Let p be SYNCBUF(os.rdbuf())." before \effects, then rephrase \effects in terms of "p":

\effects
If p is not null, calls p->set_emit_on_sync(false);

This should take care of the overfull hboxes, and reduces redundancy in the exposition.

In any case, this seems not-obviously-correct, so I'd prefer a minuted LWG teleconference consensus that this editorial fix is desirable. (We probably don't need an LWG issue if there is no effective normative change and there are no objections in LWG.)

@jwakely
Copy link
Member Author

jwakely commented Oct 20, 2020

Yes, that works and looks good. Thanks for the suggestion.

In any case, this seems not-obviously-correct, so I'd prefer a minuted LWG teleconference consensus that this editorial fix is desirable. (We probably don't need an LWG issue if there is no effective normative change and there are no objections in LWG.)

Yes, I'd prefer that too. That's why this is a draft and not submitted for review yet.

This attempts to address the problem of `Allocator` being mentioned in
the function descriptions without being defined. We cannot say that

> `os.rdbuf()` is a `basic_syncbuf<charT, traits, Allocator>*`

because firstly, that type is not defined, and secondly `os.rdbuf()` is
a `basic_streambuf<charT, traits>*` and not any other type.

By introducing SYNCBUF we can define the manipulators properly, by
talking about a base class subobject rather than "is a".

This introduces an apparently normative change that the syncbuf type
must not use a program-defined specialization. Without that additional
restriction the implementation suggested by the note doesn't work,
because program-defined specializations cannot derive from the
intermediate base class, and therefore cannot be detected by SYNCBUF.
@jwakely
Copy link
Member Author

jwakely commented Nov 13, 2020

LWG has decided this needs a DR, so isn't editorial.

@jwakely jwakely closed this Nov 13, 2020
@jensmaurer jensmaurer added lwg Issue must be reviewed by LWG. not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking. labels Nov 13, 2020
@Dani-Hub
Copy link
Member

A corresponding LWG issue has been created, this is LWG 3501.

@jensmaurer jensmaurer changed the title [ostream.manip] Introduce SYNCBUF to detect basic_syncbuf [ostream.manip] Introduce SYNCBUF to detect basic_syncbuf LWG 3501 Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lwg Issue must be reviewed by LWG. not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants