From 9b6f0a86aff0caf490d703df052cc339d1f861fd Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 30 Aug 2023 13:08:30 +0200 Subject: [PATCH 01/19] [fmtflags.state] clarify pre/postconditions --- source/iostreams.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index c6c1b9bdfa..8d061188ed 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -1207,7 +1207,7 @@ \begin{itemdescr} \pnum \ensures -\tcode{fmtfl == flags()}. +\tcode{fmtfl == flags()} is \keyword{true}. \pnum \returns @@ -1285,7 +1285,7 @@ \begin{itemdescr} \pnum \ensures -\tcode{prec == precision()}. +\tcode{prec == precision()} is \keyword{true}. \pnum \returns @@ -1313,7 +1313,7 @@ \begin{itemdescr} \pnum \ensures -\tcode{wide == width()}. +\tcode{wide == width()} is \keyword{true}. \pnum \returns From 3bf90338bb11f3cb6d557f8b5884803e58ea857e Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 30 Aug 2023 13:10:27 +0200 Subject: [PATCH 02/19] [ios.base.locales] clarify postcondition --- source/iostreams.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 8d061188ed..c5a47c6a06 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -1344,7 +1344,7 @@ \pnum \ensures -\tcode{loc == getloc()}. +\tcode{loc == getloc()} is \keyword{true}. \pnum \returns From 83e8a2672c7507f7f50dee56671b7c3701a63c84 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 30 Aug 2023 13:16:44 +0200 Subject: [PATCH 03/19] [fpos.operations] clarify meaning of assertions/postconditions in table --- source/iostreams.tex | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index c5a47c6a06..5c21d32eb3 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -1750,7 +1750,7 @@ \tcode{O(p)} & \tcode{streamoff} & converts to \tcode{offset} & - \tcode{P(O(p)) == p} \\ \rowsep + \tcode{P(O(p)) == p} is \keyword{true} \\ \rowsep \tcode{p == q} & \tcode{bool} & & @@ -1769,29 +1769,31 @@ \tcode{p + o} & \tcode{P} & \tcode{+} offset & - \remarks With \tcode{ql = p + o;}, then: \tcode{ql - o == p} \\ \rowsep + \remarks With \tcode{ql = p + o;}, then: + \tcode{ql - o == p} is \keyword{true} \\ \rowsep \tcode{pl += o} & \tcode{P\&} & \tcode{+=} offset & \remarks With \tcode{ql = pl;} before the \tcode{+=}, then: - \tcode{pl - o == ql} \\ \rowsep + \tcode{pl - o == ql} is \keyword{true} \\ \rowsep \tcode{p - o} & \tcode{P} & \tcode{-} offset & - \remarks With \tcode{ql = p - o;}, then: \tcode{ql + o == p} \\ \rowsep + \remarks With \tcode{ql = p - o;}, then: + \tcode{ql + o == p} is \keyword{true} \\ \rowsep \tcode{pl -= o} & \tcode{P\&} & \tcode{-=} offset & \remarks With \tcode{ql = pl;} before the \tcode{-=}, then: - \tcode{pl + o == ql} \\ \rowsep + \tcode{pl + o == ql} is \keyword{true} \\ \rowsep \tcode{o + p} & convertible to \tcode{P} & \tcode{p + o} & - \tcode{P(o + p) == p + o} \\ \rowsep + \tcode{P(o + p) == p + o} is \keyword{true} \\ \rowsep \tcode{p - q} & \tcode{streamoff} & distance & - \tcode{p == q + (p - q)} \\ + \tcode{p == q + (p - q)} is \keyword{true} \\ \end{libreqtab4c} \pnum From caf9f79cd3c7f0b83fe7e72575abb18169ae2101 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 30 Aug 2023 13:21:54 +0200 Subject: [PATCH 04/19] [basic.ios.members] clarify equality expressions --- source/iostreams.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 5c21d32eb3..6e71e30f48 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -1983,7 +1983,7 @@ \pnum \ensures -\tcode{tiestr == tie()}. +\tcode{tiestr == tie()} is \keyword{true}. \pnum \returns @@ -2017,7 +2017,7 @@ \pnum \ensures -\tcode{sb == rdbuf()}. +\tcode{sb == rdbuf()} is \keyword{true}. \pnum \returns @@ -2037,7 +2037,7 @@ \tcode{ios_base::imbue(loc)}\iref{ios.base.locales} and if -\tcode{rdbuf() != 0} +\tcode{rdbuf() != 0} is \keyword{true} then \tcode{rdbuf()->pubimbue(loc)}\iref{streambuf.locales}. @@ -2106,7 +2106,7 @@ \pnum \effects If -\tcode{(this == addressof(rhs))} is \tcode{true} +\tcode{this == addressof(rhs)} is \tcode{true}, does nothing. Otherwise assigns to the member objects of \tcode{*this} From d03c9654a9d660e491ff8a04ee7bb8ae8417f54a Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 30 Aug 2023 13:24:46 +0200 Subject: [PATCH 05/19] [iostate.flags] clarify boolean expressions --- source/iostreams.tex | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 6e71e30f48..3df7fc750f 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -2279,8 +2279,8 @@ \begin{itemdescr} \pnum \effects -If \tcode{((state | (rdbuf() ? goodbit : badbit)) \& exceptions()) == 0}, -returns. +If \tcode{((state | (rdbuf() ? goodbit : badbit)) \& exceptions()) == 0} +is \keyword{true}, returns. Otherwise, the function throws an object of class \tcode{ios_base::failure}\iref{ios.failure}, constructed with @@ -2290,11 +2290,11 @@ \pnum \ensures If -\tcode{rdbuf() != 0} +\tcode{rdbuf() != 0} is \keyword{true} then -\tcode{state == rdstate()}; +\tcode{state == rdstate()} is \keyword{true}; otherwise -\tcode{rdstate() == (state | ios_base::badbit)}. +\tcode{rdstate() == (state | ios_base::badbit)} is \keyword{true}. \end{itemdescr} \indexlibrarymember{setstate}{basic_ios}% @@ -2319,7 +2319,7 @@ \begin{itemdescr} \pnum \returns -\tcode{rdstate() == 0} +\tcode{rdstate() == 0} is \keyword{true}. \end{itemdescr} \indexlibrarymember{eof}{basic_ios}% @@ -2402,7 +2402,7 @@ \pnum \ensures -\tcode{except == exceptions()}. +\tcode{except == exceptions()} is \keyword{true}. \end{itemdescr} \rSec2[std.ios.manip]{\tcode{ios_base} manipulators} From ba868adfe45d2c00926ef6b7cb1bc1284afcf5af Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 30 Aug 2023 13:27:00 +0200 Subject: [PATCH 06/19] [streambuf.cons] clarify boolean expressions --- source/iostreams.tex | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 3df7fc750f..034885d59e 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -3158,14 +3158,15 @@ \begin{itemdescr} \pnum \ensures +The following expressions yield \keyword{true}: \begin{itemize} -\item \tcode{eback() == rhs.eback()} -\item \tcode{gptr() == rhs.gptr()} -\item \tcode{egptr() == rhs.egptr()} -\item \tcode{pbase() == rhs.pbase()} -\item \tcode{pptr() == rhs.pptr()} -\item \tcode{epptr() == rhs.epptr()} -\item \tcode{getloc() == rhs.getloc()} +\item \tcode{eback() == rhs.eback()}, +\item \tcode{gptr() == rhs.gptr()}, +\item \tcode{egptr() == rhs.egptr()}, +\item \tcode{pbase() == rhs.pbase()}, +\item \tcode{pptr() == rhs.pptr()}, +\item \tcode{epptr() == rhs.epptr()}, and +\item \tcode{getloc() == rhs.getloc()}. \end{itemize} \end{itemdescr} From 1b009f5322a6eabaef79ecb1f3cbfc68df189b05 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 30 Aug 2023 13:28:02 +0200 Subject: [PATCH 07/19] [streambuf.locales] clarify boolean expression --- source/iostreams.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 034885d59e..864a8b12c6 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -3198,7 +3198,7 @@ \pnum \ensures -\tcode{loc == getloc()}. +\tcode{loc == getloc()} is \keyword{true}. \pnum \returns From 1f647e20c53da4a74b8fb38873f0829c11bb3712 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 30 Aug 2023 13:29:18 +0200 Subject: [PATCH 08/19] [streambuf.assign] clarify boolean expressions --- source/iostreams.tex | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 864a8b12c6..60384b0f1d 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -3436,14 +3436,15 @@ \begin{itemdescr} \pnum \ensures +The following expressions yield \keyword{true}: \begin{itemize} -\item \tcode{eback() == rhs.eback()} -\item \tcode{gptr() == rhs.gptr()} -\item \tcode{egptr() == rhs.egptr()} -\item \tcode{pbase() == rhs.pbase()} -\item \tcode{pptr() == rhs.pptr()} -\item \tcode{epptr() == rhs.epptr()} -\item \tcode{getloc() == rhs.getloc()} +\item \tcode{eback() == rhs.eback()}, +\item \tcode{gptr() == rhs.gptr()}, +\item \tcode{egptr() == rhs.egptr()}, +\item \tcode{pbase() == rhs.pbase()}, +\item \tcode{pptr() == rhs.pptr()}, +\item \tcode{epptr() == rhs.epptr()}, and +\item \tcode{getloc() == rhs.getloc()}. \end{itemize} \pnum From f1e718161cd34ceb162447f45cb1011f5b544565 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 30 Aug 2023 13:32:58 +0200 Subject: [PATCH 09/19] [streambuf.virt.get] clarify boolean expression --- source/iostreams.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 60384b0f1d..797e87d14d 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -3841,7 +3841,7 @@ otherwise either \tcode{gptr()} is null or -\tcode{gptr() == egptr()}. +\tcode{gptr() == egptr()} is \keyword{true}. \pnum If From 82e93c12b1a2c3f05d246b560239c5da462a970c Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 30 Aug 2023 13:33:37 +0200 Subject: [PATCH 10/19] [streambuf.virt.pback] clarify boolean expression --- source/iostreams.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 797e87d14d..330aef0d06 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -3987,7 +3987,7 @@ call this virtual function only when \tcode{gptr()} is null, -\tcode{gptr() == eback()}, +\tcode{gptr() == eback()} is \keyword{true}, or \tcode{traits::eq(traits::to_char_type(c), gptr()[-1])} returns From 9e54ade13091e765a0aa97ac330fa4c2b68d78a5 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 30 Aug 2023 13:34:46 +0200 Subject: [PATCH 11/19] [streambuf.virt.put] clarify boolean expression --- source/iostreams.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 330aef0d06..6e130e06b9 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -4073,7 +4073,7 @@ and \tcode{pptr()} are set so that: -\tcode{pptr() - pbase() == r} +\tcode{pptr() - pbase() == r} is \keyword{true} and the \tcode{r} characters starting at \tcode{pbase()} are the associated output stream. From dd5b0582db064f9479796214fe626c60dc481b9b Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 30 Aug 2023 13:35:53 +0200 Subject: [PATCH 12/19] [istream.cons] clarify boolean expression --- source/iostreams.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 6e130e06b9..951dc88860 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -4424,7 +4424,7 @@ \pnum \ensures -\tcode{gcount() == 0}. +\tcode{gcount() == 0} is \keyword{true}. \end{itemdescr} From 5d9974a2b4a00b358a69f39cf41b0486e401e43b Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 30 Aug 2023 13:37:55 +0200 Subject: [PATCH 13/19] [istream.sentry] clarify boolean expressions --- source/iostreams.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 951dc88860..6fc5f06c9a 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -4594,9 +4594,9 @@ \tcode{is.good()} is \tcode{true}, -\tcode{ok_ != false} +\tcode{ok_} is \keyword{true} otherwise, -\tcode{ok_ == false}. +\tcode{ok_} is \keyword{false}. During preparation, the constructor may call \tcode{setstate(failbit)} (which may throw From fb8f2941e990c2a375cbe47e2767dd6e08c9c049 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 30 Aug 2023 13:39:09 +0200 Subject: [PATCH 14/19] [istream.formatted.reqmts] clarify boolean expression --- source/iostreams.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 6fc5f06c9a..fbee9355c6 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -4668,7 +4668,8 @@ If an exception is thrown during input then \tcode{ios_base::badbit} is set in the local error state, \tcode{*this}'s error state is set to the local error state, and -the exception is rethrown if \tcode{(exceptions() \& badbit) != 0}. +the exception is rethrown +if \tcode{(exceptions() \& badbit) != 0} is \keyword{true}. After extraction is done, the input function calls \tcode{setstate}, which sets \tcode{*this}'s error state to the local error state, and may throw an exception. From 00d79c5417d75f64b8c12bbd84841730b3ee8f90 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 30 Aug 2023 13:40:49 +0200 Subject: [PATCH 15/19] [istream.unformatted] clarify boolean expression --- source/iostreams.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index fbee9355c6..55809b0b42 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -5053,7 +5053,8 @@ If an exception is thrown during input then \tcode{ios_base::badbit} is set in the local error state, \tcode{*this}'s error state is set to the local error state, and -the exception is rethrown if \tcode{(exceptions() \& badbit) != 0}. +the exception is rethrown +if \tcode{(exceptions() \& badbit) != 0} is \keyword{true}. If no exception has been thrown it stores the number of characters extracted in a member object. From 7389b58fff4d4dff7c350a5b4e0e5900e4643e2e Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 30 Aug 2023 13:46:56 +0200 Subject: [PATCH 16/19] [iostream.cons] clarify boolean expression --- source/iostreams.tex | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 55809b0b42..ac2021afae 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -5383,7 +5383,7 @@ Characters are extracted until any of the following occurs: \begin{itemize} \item -\tcode{n != numeric_limits::max()}\iref{numeric.limits} +\tcode{n != numeric_limits::max()} is \keyword{true}\iref{numeric.limits} and \tcode{n} characters have been extracted so far \item @@ -5493,7 +5493,7 @@ into successive locations of an array whose first element is designated by \tcode{s}. If -\tcode{rdbuf()->in_avail() == -1}, +\tcode{rdbuf()->in_avail() == -1} is \keyword{true}, calls \tcode{setstate(eofbit)} (which may throw @@ -5502,11 +5502,11 @@ \begin{itemize} \item If -\tcode{rdbuf()->in_avail() == 0}, +\tcode{rdbuf()->in_avail() == 0} is \keyword{true}, extracts no characters \item If -\tcode{rdbuf()->in_avail() > 0}, +\tcode{rdbuf()->in_avail() > 0} is \keyword{true}, extracts \tcode{min(rdbuf()->in_avail(), n))}. \end{itemize} @@ -5644,7 +5644,7 @@ \pnum \returns After constructing a \tcode{sentry} object, if -\tcode{fail() != false}, +\tcode{fail()} is \keyword{true}, returns \tcode{pos_type(-1)} to indicate failure. @@ -5667,7 +5667,7 @@ returned by subsequent calls to \tcode{gcount()}. After constructing a \tcode{sentry} object, if -\tcode{fail() != true}, +\tcode{fail()} is \keyword{false}, executes \tcode{rdbuf()->pubseekpos(pos, ios_base::in)}. In case of failure, the function calls @@ -5692,7 +5692,7 @@ does not count the number of characters extracted, and does not affect the value returned by subsequent calls to \tcode{gcount()}. After constructing a \tcode{sentry} object, if -\tcode{fail() != true}, +\tcode{fail()} is \keyword{false}, executes \tcode{rdbuf()->pubseekoff(off, dir, ios_base::in)}. In case of failure, the function calls \tcode{setstate(\brk{}failbit)} (which may throw @@ -5821,9 +5821,9 @@ \pnum \ensures -\tcode{rdbuf() == sb} +\tcode{rdbuf() == sb} is \keyword{true} and -\tcode{gcount() == 0}. +\tcode{gcount() == 0} is \keyword{true}. \end{itemdescr} \indexlibraryctor{basic_iostream}% From 7dc13f07c846161e7d1a4f94caae568ceb4814f2 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 30 Aug 2023 13:48:12 +0200 Subject: [PATCH 17/19] [ostream.cons] clarify boolean expression --- source/iostreams.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index ac2021afae..6c125b566c 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -6097,7 +6097,7 @@ \pnum \ensures -\tcode{rdbuf() == sb}. +\tcode{rdbuf() == sb} is \keyword{true}. \end{itemdescr} \indexlibraryctor{basic_ostream}% From 2ba3cf5b9e2228cdb258b0541a188d0a7135ab43 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 30 Aug 2023 13:48:59 +0200 Subject: [PATCH 18/19] [ostream.sentry] clarify boolean expression --- source/iostreams.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 6c125b566c..b91feb2f2a 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -6208,9 +6208,9 @@ \tcode{os.good()} is \tcode{true}, -\tcode{ok_ == true} +\tcode{ok_} is \keyword{true} otherwise, -\tcode{ok_ == false}. +\tcode{ok_} is \keyword{false}. During preparation, the constructor may call \tcode{setstate(failbit)} (which may throw From a1d2aae62b9f8c3aa344a3b77ba7c4ee127f4a1c Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 30 Aug 2023 13:50:59 +0200 Subject: [PATCH 19/19] [ostream.seeks] clarify boolean expression --- source/iostreams.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index b91feb2f2a..666dad7142 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -6269,7 +6269,7 @@ \pnum \returns If -\tcode{fail() != false}, +\tcode{fail()} is \keyword{true}, returns \tcode{pos_type(-1)} to indicate failure. @@ -6286,7 +6286,7 @@ \pnum \effects If -\tcode{fail() != true}, +\tcode{fail()} is \keyword{false}, executes \tcode{rdbuf()->pubseekpos(pos, ios_base::out)}. In case of failure, the function calls @@ -6308,7 +6308,7 @@ \pnum \effects If -\tcode{fail() != true}, +\tcode{fail()} is \keyword{false}, executes \tcode{rdbuf()->pubseekoff(off, dir, ios_base::out)}. In case of failure, the function calls \tcode{setstate(failbit)}