Skip to content

[streambuf.virtuals] Simplify the logic of exposition; remove several unneeded lists #1111

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

Merged
merged 1 commit into from
Nov 26, 2016
Merged
Changes from all 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
85 changes: 29 additions & 56 deletions source/iostreams.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3711,97 +3711,73 @@
\pnum
The
\term{pending sequence}
of characters is defined as the concatenation of:
\begin{enumeratea}
\item
If
\tcode{gptr()}
is non-null, then the
of characters is defined as the concatenation of
\begin{itemize}
\item the empty sequence if \tcode{gptr()} is null, otherwise the
\tcode{egptr() - gptr()}
characters starting at
\tcode{gptr()},
otherwise the empty sequence.
followed by
\item
Some sequence (possibly empty) of characters read from the input sequence.
\end{enumeratea}
some (possibly empty) sequence of characters read from the input sequence.
\end{itemize}

\pnum
The
\term{result character}
is
\begin{enumeratea}
\item
If the pending sequence is non-empty, the first character of the sequence.
\item
If the pending sequence
is
empty then the next character that would be read from the input sequence.
\end{enumeratea}
the first character of the pending sequence if it is non-empty,
otherwise
the next character that would be read from the input sequence.

\pnum
The
\term{backup sequence}
is defined as the concatenation of:
\begin{enumeratea}
\item
If
\tcode{eback()}
is null then empty,
\item
Otherwise the
is the empty sequence if \tcode{eback()} is null, otherwise the
\tcode{gptr() - eback()}
characters beginning at
\tcode{eback()}.
\end{enumeratea}

\pnum
\effects
The function sets up the
\tcode{gptr()}
and
\tcode{egptr()}
satisfying one of:
\begin{enumeratea}
\item
If the pending sequence is non-empty,
such that
if the pending sequence is non-empty, then
\tcode{egptr()}
is non-null and
\tcode{egptr() - gptr()}
characters starting at
\tcode{gptr()}
are the characters in the pending sequence
\item
If the pending sequence is empty, either
\tcode{gptr()}
are the characters in the pending sequence, otherwise
either \tcode{gptr()}
is null or
\tcode{gptr()}
and
\tcode{egptr()}
are set to the same non-null pointer value.
\end{enumeratea}
\tcode{gptr() == egptr()}.

\pnum
If
\tcode{eback()}
and
\tcode{gptr()}
are non-null then the function is not constrained as to their contents, but the ``usual backup condition'' is that either:
\begin{enumeratea}
are non-null then the function is not constrained as to their contents, but the ``usual backup condition'' is that either
\begin{itemize}
\item
If the backup sequence contains at least
the backup sequence contains at least
\tcode{gptr() - eback()}
characters, then the
characters, in which case the
\tcode{gptr() - eback()}
Copy link
Member

Choose a reason for hiding this comment

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

"and then" -> "in which case"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, good idea.

characters starting at
\tcode{eback()}
agree with the last
\tcode{gptr() - eback()}
characters of the backup sequence.
characters of the backup sequence, or
\item
Or the \tcode{n} characters starting at
the \tcode{n} characters starting at
\tcode{gptr() - n}
agree with the backup sequence (where \tcode{n} is the length of the backup sequence)
\end{enumeratea}
agree with the backup sequence (where \tcode{n} is the length of the backup sequence).
\end{itemize}

\pnum
\default
Expand Down Expand Up @@ -3952,22 +3928,19 @@
Consumes some initial subsequence of the characters of the
\term{pending sequence}.
The pending sequence is defined as the concatenation of
\begin{enumeratea}
\begin{itemize}
\item
if
\tcode{pbase()}
is null then the empty sequence otherwise,
the empty sequence if \tcode{pbase()} is not null, otherwise the
\tcode{pptr() - pbase()}
characters beginning at
\tcode{pbase()}.
\tcode{pbase()}, followed by
\item
the empty sequence
if
\tcode{traits::eq_int_type(c, traits::eof())}
returns
\tcode{true},
then the empty sequence
otherwise, the sequence consisting of \tcode{c}.
\end{enumeratea}
\tcode{true}, otherwise the sequence consisting of \tcode{c}.
\end{itemize}

\pnum
\remarks
Expand Down