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

[iostreams] Make "sentry" object code font throughout #5031

Closed
jensmaurer opened this issue Oct 15, 2021 · 4 comments · Fixed by #5052
Closed

[iostreams] Make "sentry" object code font throughout #5031

jensmaurer opened this issue Oct 15, 2021 · 4 comments · Fixed by #5052
Assignees

Comments

@jensmaurer
Copy link
Member

We have a class called "sentry", so it should be in code font. (It's not just any class that people might claim acts as a sentry in the plain English meaning.)

@tkoeppe
Copy link
Contributor

tkoeppe commented Oct 18, 2021

@jwakely: The proposed change would seem like an improvement. Is "sentry object" somehow a term of art at the moment?

@jwakely
Copy link
Member

jwakely commented Oct 19, 2021

It's not. Some non-code-font uses are just inconsistent/wrong, e.g. [istream.unformatted] p1 where we're specifically talking about the sentry class, so "the sentry constructor" should obviously be code font too. It's the constructor of the sentry object introduced earlier in the paragraph.

Other cases just seem like inconsistencies. [istream.extractors] p12 says "After a sentry object is constructed" and p14 says "After a sentry object is constructed". There is no difference intended here, they should be consistent. Both are referring to the actions of constructing a sentry as specified by [istream.unformatted] p1.

We could introduce wording that says "The object of type sentry is referred to as the sentry object" in two places (one for istream and one for ostream) but it seems simpler to just use code font everywhere. I checked every case in Clause 29 [input.output] and they should all be code font.

@jwakely
Copy link
Member

jwakely commented Oct 19, 2021

[string.io] p1 has:

Effects: Behaves as a formatted input function (29.7.4.3.1). After constructing a sentry object, if the
sentry converts to true, ...

[string.io] p6 is similar. It should be code font, but it also seems a little informal/imprecise. Converts to true spontaneously, by radioactive decay? In [istream.formatted.reqmts] we say "if the sentry object returns true, when converted to a value of type bool" which is more verbose but more precise. We don't have a name for the object so we can't say "if static_cast<bool>(cerberus) is true" instead.

Those are the only uses of "sentry" (in any font) outside Clause 29, except for a code example in [locale.general] (which is obviously already in code font).

@tkoeppe
Copy link
Contributor

tkoeppe commented Oct 19, 2021

Great, thank you! Let's do this then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants