Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 9 additions & 25 deletions source/iostreams.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4571,7 +4571,7 @@
that are part of the library.
The semantics of the constructor used in user code is as specified.
\end{footnote}
If \tcode{noskipws} is zero and
If \tcode{noskipws} is \tcode{false} and
\tcode{is.flags() \& ios_base::skipws}
is nonzero, the function extracts and discards each character as long as
the next available input character \tcode{c} is a whitespace character.
Expand All @@ -4587,32 +4587,13 @@
\tcode{ios_base::failure}).

\pnum
\remarks
The constructor
\begin{codeblock}
explicit sentry(basic_istream& is, bool noskipws = false)
\end{codeblock}
uses the currently imbued locale in \tcode{is},
to determine whether the next input character is
whitespace or not.

\pnum
To decide if the character \tcode{c} is a whitespace character,
the constructor performs as if it executes the following code fragment:
\begin{codeblock}
const ctype<charT>& ctype = use_facet<ctype<charT>>(is.getloc());
if (ctype.is(ctype.space, c) != 0)
// \tcode{c} is a whitespace character.
\end{codeblock}
The currently imbued locale in \tcode{is} is used
to determine whether or not the next input character is whitespace.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Whether" already means "whether or not", so can we drop the "or not"?

On the other hand, "if" does not already mean "only if", so can we say "if and only if" below?

And maybe we can also change the full stop after "is whitespace" to a colon to signal that what follows is the explanation of what whitespace is?

The character \tcode{c} is a whitespace character if
\tcode{ct.is(ct.space, c)} is \tcode{true},
where \tcode{ct} is \tcode{use_facet<ctype<charT>>(is.getloc())}.

\pnum
If, after any preparation is completed,
\tcode{is.good()}
is
\tcode{true},
\tcode{\exposid{ok_} != false}
otherwise,
\tcode{\exposid{ok_} == false}.
During preparation, the constructor may call
\tcode{setstate(failbit)}
(which may throw
Expand All @@ -4625,6 +4606,9 @@
\indextext{implementation-dependent}%
implementation-dependent operations.
\end{footnote}

\pnum
After any preparation is completed, \exposid{ok_} is set to the value of \tcode{is.good()}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks!

\end{itemdescr}

\indexlibrarydtor{sentry}%
Expand Down