From b136f50d97c097f5491c66ed7357f81d2bbdc995 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Fri, 15 Nov 2019 14:11:01 -0800 Subject: [PATCH] P1721R2 Mandating the Standard Library: Clause 29 - Input/output library Some minor rewording to avoid bad linebreaks. --- source/iostreams.tex | 549 ++++++++++++++----------------------------- 1 file changed, 177 insertions(+), 372 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index efe3bc8f09..e869e787d0 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -451,7 +451,7 @@ as specified in the C standard library. \pnum -Concurrent access to a synchronized\iref{ios.members.static} standard iostream object's formatted and unformatted input\iref{istream} and output\iref{ostream} functions or a standard C stream by multiple threads shall not result in a data race\iref{intro.multithread}. +Concurrent access to a synchronized\iref{ios.members.static} standard iostream object's formatted and unformatted input\iref{istream} and output\iref{ostream} functions or a standard C stream by multiple threads does not result in a data race\iref{intro.multithread}. \begin{note} Users must still synchronize concurrent use of these objects and streams by multiple threads if they wish to avoid interleaved characters. \end{note} @@ -897,8 +897,7 @@ \begin{itemdescr} \pnum \effects -Constructs an object of class -\tcode{failure} by constructing the base class with \tcode{msg} and \tcode{ec}. +Constructs the base class with \tcode{msg} and \tcode{ec}. \end{itemdescr} \indexlibraryctor{ios_base::failure}% @@ -909,8 +908,7 @@ \begin{itemdescr} \pnum \effects -Constructs an object of class -\tcode{failure} by constructing the base class with \tcode{msg} and \tcode{ec}. +Constructs the base class with \tcode{msg} and \tcode{ec}. \end{itemdescr} \rSec4[ios.fmtflags]{Type \tcode{ios_base::fmtflags}} @@ -1112,8 +1110,6 @@ \begin{itemdescr} \pnum \effects -Constructs an object of class -\tcode{Init}. Constructs and initializes the objects \tcode{cin}, \tcode{cout}, \tcode{cerr}, \tcode{clog}, \tcode{wcin}, \tcode{wcout}, \tcode{wcerr}, and \tcode{wclog} if they have not already been constructed and initialized. @@ -1127,8 +1123,6 @@ \begin{itemdescr} \pnum \effects -Destroys an object of class -\tcode{Init}. If there are no other instances of the class still in existence, calls \indexlibraryglobal{flush}% @@ -1296,14 +1290,14 @@ returns the new locale value \tcode{loc}. +\pnum +\ensures +\tcode{loc == getloc()}. + \pnum \returns The previous value of \tcode{getloc()}. - -\pnum -\ensures -\tcode{loc == getloc()}. \end{itemdescr} \indexlibrarymember{getloc}{ios_base}% @@ -1397,7 +1391,7 @@ \pnum \remarks -Concurrent access to this function by multiple threads shall not result in a data +Concurrent access to this function by multiple threads does not result in a data race\iref{intro.multithread}. \end{itemdescr} @@ -1408,7 +1402,7 @@ \begin{itemdescr} \pnum -\requires +\expects \tcode{idx} is a value obtained by a call to \tcode{xalloc}. \pnum @@ -1458,7 +1452,7 @@ \begin{itemdescr} \pnum -\requires +\expects \tcode{idx} is a value obtained by a call to \tcode{xalloc}. \pnum @@ -1513,6 +1507,12 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\expects +The function +\tcode{fn} +does not throw exceptions. + \pnum \effects Registers the pair @@ -1530,12 +1530,6 @@ registration. Functions registered while a callback function is active are not called until the next event. -\pnum -\requires -The function -\tcode{fn} -shall not throw exceptions. - \pnum \remarks Identical pairs are not merged. @@ -1569,8 +1563,6 @@ \begin{itemdescr} \pnum \effects -Destroys an object of class -\tcode{ios_base}. Calls each registered callback pair \tcode{(fn, idx)}\iref{ios.base.callback} as \tcode{(*fn)(\brk{}erase_event, *this, idx)} @@ -1816,9 +1808,7 @@ \begin{itemdescr} \pnum \effects -Constructs an object of class -\tcode{basic_ios}, -assigning initial values to its member objects by calling +Assigns initial values to its member objects by calling \tcode{init(sb)}. \end{itemdescr} @@ -1830,9 +1820,7 @@ \begin{itemdescr} \pnum \effects -Constructs an object of class -\tcode{basic_ios}\iref{ios.base.cons} -leaving its member objects uninitialized. The object +Leaves its member objects uninitialized. The object shall be initialized by calling \tcode{basic_ios::init} before its first use or before it is destroyed, whichever comes first; otherwise the @@ -1909,8 +1897,8 @@ \begin{itemdescr} \pnum -\requires -If \tcode{tiestr} is not null, \tcode{tiestr} shall not be reachable by +\expects +If \tcode{tiestr} is not null, \tcode{tiestr} is not reachable by traversing the linked list of tied stream objects starting from \tcode{tiestr->tie()}. @@ -1943,15 +1931,15 @@ \end{itemdecl} \begin{itemdescr} -\pnum -\ensures -\tcode{sb == rdbuf()}. - \pnum \effects Calls \tcode{clear()}. +\pnum +\ensures +\tcode{sb == rdbuf()}. + \pnum \returns The previous value of @@ -2039,7 +2027,7 @@ \pnum \effects If -\tcode{(this == addressof(rhs))} +\tcode{(this == addressof(rhs))} is \tcode{true} does nothing. Otherwise assigns to the member objects of \tcode{*this} @@ -2070,7 +2058,6 @@ \tcode{(*fn)(copyfmt_event, *this, idx)}; \item then, calls \tcode{exceptions(rhs.exceptions())}. - \end{itemize} \pnum @@ -2120,12 +2107,12 @@ \begin{itemdescr} \pnum \ensures -\tcode{*this} shall have the state that +\tcode{*this} has the state that \tcode{rhs} had before the function call, except that -\tcode{rdbuf()} shall return 0. \tcode{rhs} shall be in a valid but -unspecified state, except that \tcode{rhs.rdbuf()} shall return the +\tcode{rdbuf()} returns \tcode{nullptr}. \tcode{rhs} is in a valid but +unspecified state, except that \tcode{rhs.rdbuf()} returns the same value as it returned before the function call, and -\tcode{rhs.tie()} shall return 0. +\tcode{rhs.tie()} returns \tcode{nullptr}. \end{itemdescr} \indexlibrarymember{swap}{basic_ios}% @@ -2137,9 +2124,9 @@ \pnum \effects The states of \tcode{*this} and \tcode{rhs} -shall be exchanged, except that \tcode{rdbuf()} shall return the same +are exchanged, except that \tcode{rdbuf()} returns the same value as it returned before the function call, and \tcode{rhs.rdbuf()} -shall return the same value as it returned before the function call. +returns the same value as it returned before the function call. \end{itemdescr} \indexlibrarymember{set_rdbuf}{basic_ios}% @@ -2149,7 +2136,8 @@ \begin{itemdescr} \pnum -\requires \tcode{sb != nullptr}. +\expects +\tcode{sb != nullptr} is \tcode{true}. \pnum \effects @@ -2159,7 +2147,7 @@ \pnum \ensures -\tcode{rdbuf() == sb}. +\tcode{rdbuf() == sb} is \tcode{true}. \pnum \throws @@ -3044,9 +3032,7 @@ \begin{itemdescr} \pnum \effects -Constructs an object of class -\tcode{basic_streambuf} -and initializes:\footnote{The default constructor is protected for class +Initializes:\footnote{The default constructor is protected for class \tcode{basic_streambuf} to assure that only objects for classes derived from this class may be constructed.} @@ -3078,13 +3064,8 @@ \end{itemdecl} \begin{itemdescr} -\pnum -\effects -Constructs a copy of \tcode{rhs}. - \pnum \ensures - \begin{itemize} \item \tcode{eback() == rhs.eback()} \item \tcode{gptr() == rhs.gptr()} @@ -3117,15 +3098,15 @@ \end{itemdecl} \begin{itemdescr} -\pnum -\ensures -\tcode{loc == getloc()}. - \pnum \effects Calls \tcode{imbue(loc)}. +\pnum +\ensures +\tcode{loc == getloc()}. + \pnum \returns Previous value of @@ -3249,7 +3230,7 @@ \begin{itemdescr} \pnum -\returns +\effects If the input sequence read position is not available, returns \tcode{uflow()}. @@ -3293,7 +3274,7 @@ \begin{itemdescr} \pnum -\returns +\effects If the input sequence putback position is not available, or if \tcode{traits::eq(c, gptr()[-1])} @@ -3311,7 +3292,7 @@ \begin{itemdescr} \pnum -\returns +\effects If the input sequence putback position is not available, returns \tcode{pbackfail()}. @@ -3329,7 +3310,7 @@ \begin{itemdescr} \pnum -\returns +\effects If the output sequence write position is not available, returns \tcode{overflow(traits::to_int_type(c))}. @@ -3360,14 +3341,8 @@ \end{itemdecl} \begin{itemdescr} -\pnum -\effects -Assigns the data members of \tcode{rhs} -to \tcode{*this}. - \pnum \ensures - \begin{itemize} \item \tcode{eback() == rhs.eback()} \item \tcode{gptr() == rhs.gptr()} @@ -3452,7 +3427,7 @@ \tcode{gbeg == eback()}, \tcode{gnext == gptr()}, and -\tcode{gend == egptr()}. +\tcode{gend == egptr()} are all \tcode{true}. \end{itemdescr} \rSec4[streambuf.put.area]{Put area access} @@ -3512,7 +3487,7 @@ \tcode{pbeg == pbase()}, \tcode{pbeg == pptr()}, and -\tcode{pend == epptr()}. +\tcode{pend == epptr()} are all \tcode{true}. \end{itemdescr} \rSec3[streambuf.virtuals]{Virtual functions} @@ -3823,12 +3798,11 @@ \begin{itemdescr} \pnum -\requires +\expects The constraints are the same as for \tcode{underflow()}, -except that the result character shall be transferred from the pending -sequence to the backup sequence, and the pending sequence shall not -be empty before the transfer. +except that the result character is transferred from the pending +sequence to the backup sequence, and the pending sequence is not empty before the transfer. \pnum \default @@ -3984,9 +3958,9 @@ argument character sequence. \pnum -\requires +\expects Every overriding definition of this virtual function -shall obey the following constraints: +obeys the following constraints: \begin{itemize} \item The effect of consuming a character on the associated output sequence is @@ -4006,7 +3980,7 @@ \tcode{pbase()} and \tcode{pptr()} -shall be set so that: +are set so that: \tcode{pptr() - pbase() == r} and the \tcode{r} characters starting at \tcode{pbase()} @@ -4324,8 +4298,7 @@ \begin{itemdescr} \pnum \effects -Constructs an object of class -\tcode{basic_istream}, initializing the base class subobject with +Initializes the base class subobject with \tcode{basic_ios::init(sb)}\iref{basic.ios.cons}. \pnum @@ -4342,11 +4315,10 @@ \begin{itemdescr} \pnum \effects -Move constructs from the rvalue \tcode{rhs}. -This is accomplished by default constructing the base class, copying the -\tcode{gcount()} from \tcode{rhs}, calling +Default constructs the base class, copies the +\tcode{gcount()} from \tcode{rhs}, calls \tcode{basic_ios::move(rhs)} to initialize the base -class, and setting the \tcode{gcount()} for \tcode{rhs} to 0. +class, and sets the \tcode{gcount()} for \tcode{rhs} to 0. \end{itemdescr} \indexlibrarydtor{basic_istream}% @@ -4355,11 +4327,6 @@ \end{itemdecl} \begin{itemdescr} -\pnum -\effects -Destroys an object of class -\tcode{basic_istream}. - \pnum \remarks Does not perform any operations of @@ -4376,7 +4343,7 @@ \begin{itemdescr} \pnum \effects -As if by \tcode{swap(rhs)}. +Equivalent to: \tcode{swap(rhs)}. \pnum \returns @@ -4535,8 +4502,7 @@ \begin{itemdescr} \pnum -\effects -Returns +\returns \tcode{ok_}. \end{itemdescr} @@ -5587,6 +5553,9 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\constraints The expression \tcode{is >> std::forward(x)} is well-formed when treated as an unevaluated operand. + \pnum \effects Equivalent to: @@ -5594,11 +5563,6 @@ is >> std::forward(x); return is; \end{codeblock} - -\pnum -\remarks -This function shall not participate in overload resolution -unless the expression \tcode{is >> std::forward(x)} is well-formed. \end{itemdescr} \rSec3[iostreamclass]{Class template \tcode{basic_iostream}} @@ -5686,11 +5650,6 @@ \end{itemdecl} \begin{itemdescr} -\pnum -\effects -Destroys an object of class -\tcode{basic_iostream}. - \pnum \remarks Does not perform any operations on @@ -5707,7 +5666,7 @@ \begin{itemdescr} \pnum \effects -As if by \tcode{swap(rhs)}. +Equivalent to: \tcode{swap(rhs)}. \end{itemdescr} \indexlibrarymember{swap}{basic_iostream}% @@ -5955,11 +5914,6 @@ \end{itemdecl} \begin{itemdescr} -\pnum -\effects -Destroys an object of class -\tcode{basic_ostream}. - \pnum \remarks Does not perform any operations on @@ -5976,7 +5930,7 @@ \begin{itemdescr} \pnum \effects -As if by \tcode{swap(rhs)}. +Equivalent to: \tcode{swap(rhs)}. \pnum \returns @@ -6519,8 +6473,8 @@ \begin{itemdescr} \pnum -\requires -\tcode{s} shall not be a null pointer. +\expects +\tcode{s} is not a null pointer. \pnum \effects @@ -6811,6 +6765,9 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\constraints The expression \tcode{os << x} is well-formed when treated as an unevaluated operand. + \pnum \effects As if by: \tcode{os << x;} @@ -6818,11 +6775,6 @@ \pnum \returns \tcode{os}. - -\pnum -\remarks -This function shall not participate in overload resolution -unless the expression \tcode{os << x} is well-formed. \end{itemdescr} @@ -6864,10 +6816,11 @@ } \end{codeblock} -The expression \tcode{out << resetiosflags(mask)} shall have +The expression \tcode{out << resetiosflags(mask)} has type \tcode{basic_ostream\&} and value \tcode{out}. The -expression \tcode{in >> resetiosflags(mask)} shall have type -\tcode{basic_istream\&} and value \tcode{in}. \end{itemdescr} +expression \tcode{in >> resetiosflags(mask)} has type +\tcode{basic_istream\&} and value \tcode{in}. +\end{itemdescr} \indexlibraryglobal{setiosflags}% \begin{itemdecl} @@ -6904,14 +6857,14 @@ The expression \tcode{out << setiosflags(mask)} -shall have type +has type \tcode{basic_ostream\&} and value \tcode{out}. The expression \tcode{in >> setiosflags(mask)} -shall have type -\tcode{basic_istream\&} +has type +\tcode{basic_istream\&} and value \tcode{in}. \end{itemdescr} @@ -6953,13 +6906,13 @@ The expression \tcode{out << setbase(base)} -shall have type +has type \tcode{basic_ostream\&} and value \tcode{out}. The expression \tcode{in >> setbase(base)} -shall have type +has type \tcode{basic_istream\&} and value \tcode{in}. @@ -6994,7 +6947,7 @@ The expression \tcode{out << setfill(c)} -shall have type +has type \tcode{basic_ostream\&} and value \tcode{out}. @@ -7034,13 +6987,13 @@ The expression \tcode{out << setprecision(n)} -shall have type +has type \tcode{basic_ostream\&} and value \tcode{out}. The expression \tcode{in >> setprecision(n)} -shall have type +has type \tcode{basic_istream\&} and value \tcode{in}. @@ -7080,13 +7033,13 @@ The expression \tcode{out << setw(n)} -shall have type +has type \tcode{basic_ostream\&} and value \tcode{out}. The expression \tcode{in >> setw(n)} -shall have type +has type \tcode{basic_istream\&} and value \tcode{in}. @@ -7105,8 +7058,9 @@ \begin{itemdescr} \pnum -\requires The type \tcode{moneyT} shall be either \tcode{long double} or a -specialization of the \tcode{basic_string} template\iref{strings}. +\mandates +The type \tcode{moneyT} is either \tcode{long double} or +a specialization of the \tcode{basic_string} template\iref{strings}. \pnum \effects @@ -7136,7 +7090,7 @@ } \end{codeblock} -The expression \tcode{in >> get_money(mon, intl)} shall have type +The expression \tcode{in >> get_money(mon, intl)} has type \tcode{basic_istream\&} and value \tcode{in}. \end{itemdescr} @@ -7147,8 +7101,9 @@ \begin{itemdescr} \pnum -\requires The type \tcode{moneyT} shall be either \tcode{long double} or a -specialization of the \tcode{basic_string} template\iref{strings}. +\mandates +The type \tcode{moneyT} is either \tcode{long double} or +a specialization of the \tcode{basic_string} template\iref{strings}. \pnum \returns @@ -7172,9 +7127,8 @@ } \end{codeblock} -The expression \tcode{out << put_money(mon, intl)} shall have type +The expression \tcode{out << put_money(mon, intl)} has type \tcode{basic_ostream\&} and value \tcode{out}. - \end{itemdescr} \indexlibraryglobal{get_time}% @@ -7184,8 +7138,9 @@ \begin{itemdescr} \pnum -\requires The argument \tcode{tmb} shall be a valid pointer to an object of type \tcode{struct tm}. -The argument \tcode{fmt} shall be a valid pointer to an array of objects of type \tcode{charT} with \tcode{char_traits::length(fmt)} elements. +\expects +The argument \tcode{tmb} is a valid pointer to an object of type \tcode{struct tm}, +and \range{fmt}{fmt + char_traits::length(fmt)} is a valid range. \pnum \returns @@ -7211,7 +7166,7 @@ } \end{codeblock} -The expression \tcode{in >> get_time(tmb, fmt)} shall have type +The expression \tcode{in >> get_time(tmb, fmt)} has type \tcode{basic_istream\&} and value \tcode{in}. \end{itemdescr} @@ -7222,10 +7177,9 @@ \begin{itemdescr} \pnum -\requires The argument \tcode{tmb} shall be a valid pointer to an object of type -\tcode{struct tm}, and the argument \tcode{fmt} shall be a valid pointer to an -array of objects of type \tcode{charT} with -\tcode{char_traits::length(\brk{}fmt)} elements. +\expects +The argument \tcode{tmb} is a valid pointer to an object of type \tcode{struct tm}, +and \range{fmt}{fmt + char_traits::length(fmt)} is a valid range. \pnum \returns @@ -7249,7 +7203,7 @@ } \end{codeblock} -The expression \tcode{out << put_time(tmb, fmt)} shall have type +The expression \tcode{out << put_time(tmb, fmt)} has type \tcode{basic_ostream\&} and value \tcode{out}. \end{itemdescr} @@ -7295,7 +7249,7 @@ in~\ref{ostream.formatted.reqmts}, \tcode{seq} is inserted as if by calling \tcode{out.rdbuf()->sputn(seq, n)}, where \tcode{n} is the larger of \tcode{out.width()} and \tcode{x}, and \tcode{out.width(0)} is called. -The expression \tcode{out << quoted(s, delim, escape)} shall have type +The expression \tcode{out << quoted(s, delim, escape)} has type \tcode{basic_ostream\&} and value \tcode{out}. \end{itemdescr} @@ -7339,11 +7293,13 @@ \tcode{out << quoted(s, delim, escape)} behaves as specified for the \tcode{const basic_string\&} overload of the \tcode{quoted} function. -\end{itemize} -The expression \tcode{in >> quoted(s, delim, escape)} shall have type -\tcode{basic_istream\&} and value \tcode{in}. The expression -\tcode{out << quoted(s, delim, escape)} shall have type +\item +The expression \tcode{in >> quoted(s, delim, escape)} has type +\tcode{basic_istream\&} and value \tcode{in}. +\item +The expression \tcode{out << quoted(s, delim, escape)} has type \tcode{basic_ostream\brk{}\&} and value \tcode{out}. +\end{itemize} \end{itemdescr} \rSec1[string.streams]{String-based streams} @@ -7735,7 +7691,7 @@ \begin{itemdescr} \pnum \effects -As if by \tcode{x.swap(y)}. +Equivalent to: \tcode{x.swap(y)}. \end{itemdescr} \rSec3[stringbuf.members]{Member functions} @@ -8396,29 +8352,12 @@ Move constructs from the rvalue \tcode{rhs}. This is accomplished by move constructing the base class, and the contained \tcode{basic_stringbuf}. -Next \tcode{basic_istream::set_rdbuf(addressof(sb))} -is called to -install the contained \tcode{basic_stringbuf}. +Then calls \tcode{basic_istream::set_rdbuf(addressof(sb))} +to install the contained \tcode{basic_stringbuf}. \end{itemdescr} \rSec3[istringstream.assign]{Assignment and swap} -\indexlibrarymember{operator=}{basic_istringstream}% -\begin{itemdecl} -basic_istringstream& operator=(basic_istringstream&& rhs); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Move assigns the base and members of \tcode{*this} from the base and corresponding -members of \tcode{rhs}. - -\pnum -\returns -\tcode{*this}. -\end{itemdescr} - \indexlibrarymember{swap}{basic_istringstream}% \begin{itemdecl} void swap(basic_istringstream& rhs); @@ -8445,7 +8384,7 @@ \begin{itemdescr} \pnum \effects -As if by \tcode{x.swap(y)}. +Equivalent to: \tcode{x.swap(y)}. \end{itemdescr} \rSec3[istringstream.members]{Member functions} @@ -8733,29 +8672,12 @@ Move constructs from the rvalue \tcode{rhs}. This is accomplished by move constructing the base class, and the contained \tcode{basic_stringbuf}. -Next \tcode{basic_ostream::set_rdbuf(addressof(sb))} -is called to -install the contained \tcode{basic_stringbuf}. +Then calls \tcode{basic_ostream::set_rdbuf(addressof(sb))} +to install the contained \tcode{basic_stringbuf}. \end{itemdescr} \rSec3[ostringstream.assign]{Assignment and swap} -\indexlibrarymember{operator=}{basic_ostringstream}% -\begin{itemdecl} -basic_ostringstream& operator=(basic_ostringstream&& rhs); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Move assigns the base and members of \tcode{*this} from the base and corresponding -members of \tcode{rhs}. - -\pnum -\returns -\tcode{*this}. -\end{itemdescr} - \indexlibrarymember{swap}{basic_ostringstream}% \begin{itemdecl} void swap(basic_ostringstream& rhs); @@ -8781,7 +8703,7 @@ \begin{itemdescr} \pnum \effects -As if by \tcode{x.swap(y)}. +Equivalent to: \tcode{x.swap(y)}. \end{itemdescr} \rSec3[ostringstream.members]{Member functions} @@ -9075,28 +8997,12 @@ Move constructs from the rvalue \tcode{rhs}. This is accomplished by move constructing the base class, and the contained \tcode{basic_stringbuf}. -Next \tcode{basic_istream::set_rdbuf(addressof(sb))} is called to -install the contained \tcode{basic_stringbuf}. +Then calls \tcode{basic_istream::set_rdbuf(addressof(sb))} +to install the contained \tcode{basic_stringbuf}. \end{itemdescr} \rSec3[stringstream.assign]{Assignment and swap} -\indexlibrarymember{operator=}{basic_stringstream}% -\begin{itemdecl} -basic_stringstream& operator=(basic_stringstream&& rhs); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Move assigns the base and members of \tcode{*this} from the base and corresponding -members of \tcode{rhs}. - -\pnum -\returns -\tcode{*this}. -\end{itemdescr} - \indexlibrarymember{swap}{basic_stringstream}% \begin{itemdecl} void swap(basic_stringstream& rhs); @@ -9122,7 +9028,7 @@ \begin{itemdescr} \pnum \effects -As if by \tcode{x.swap(y)}. +Equivalent to: \tcode{x.swap(y)}. \end{itemdescr} \rSec3[stringstream.members]{Member functions} @@ -9400,9 +9306,7 @@ \begin{itemdescr} \pnum \effects -Constructs an object of class -\tcode{basic_filebuf}, -initializing the base class with +Initializes the base class with \tcode{basic_streambuf()}\iref{streambuf.cons}. \pnum @@ -9418,8 +9322,7 @@ \begin{itemdescr} \pnum \effects -Move constructs from the rvalue \tcode{rhs}. It -is \impldef{whether sequence pointers are copied by \tcode{basic_filebuf} move +It is \impldef{whether sequence pointers are copied by \tcode{basic_filebuf} move constructor} whether the sequence pointers in \tcode{*this} (\tcode{eback()}, \tcode{gptr()}, \tcode{egptr()}, \tcode{pbase()}, \tcode{pptr()}, \tcode{epptr()}) obtain @@ -9461,8 +9364,6 @@ \begin{itemdescr} \pnum \effects -Destroys an object of class -\tcode{basic_filebuf}. Calls \tcode{close()}. If an exception occurs during the destruction of the object, including the call to \tcode{close()}, the exception is caught but not rethrown (see~\ref{res.on.exception.handling}). @@ -9509,7 +9410,7 @@ \begin{itemdescr} \pnum \effects -As if by \tcode{x.swap(y)}. +Equivalent to: \tcode{x.swap(y)}. \end{itemdescr} \rSec3[filebuf.members]{Member functions} @@ -9539,7 +9440,7 @@ \begin{itemdescr} \pnum \expects -\tcode{s} shall point to a NTCTS\iref{defns.ntcts}. +\tcode{s} points to a NTCTS\iref{defns.ntcts}. \pnum \effects @@ -10034,7 +9935,7 @@ \begin{itemdescr} \pnum -\requires +\expects If the file is not positioned at its beginning and the encoding of the current locale as determined by \tcode{a_codecvt.encoding()} @@ -10131,11 +10032,9 @@ \begin{itemdescr} \pnum \effects -Constructs an object of class -\tcode{basic_ifstream}, -initializing the base class with +Initializes the base class with \tcode{basic_istream(addressof(sb))}\iref{istream.cons} -and initializing \tcode{sb} with +and \tcode{sb} with \tcode{basic_filebuf()}\iref{filebuf.cons}. \end{itemdescr} @@ -10150,11 +10049,9 @@ \begin{itemdescr} \pnum \effects -Constructs an object of class -\tcode{basic_ifstream}, -initializing the base class with +Initializes the base class with \tcode{basic_istream(addressof(sb))}\iref{istream.cons} -and initializing \tcode{sb} with +and \tcode{sb} with \tcode{basic_filebuf()}\iref{filebuf.cons}, then calls \tcode{rdbuf()->open(s, mode | ios_base::in)}. @@ -10173,7 +10070,7 @@ \begin{itemdescr} \pnum \effects -The same as \tcode{basic_ifstream(s.c_str(), mode)}. +Equivalent to: \tcode{basic_ifstream(s.c_str(), mode)}. \end{itemdescr} \indexlibraryctor{basic_ifstream}% @@ -10184,32 +10081,13 @@ \begin{itemdescr} \pnum \effects -Move constructs from the rvalue \tcode{rhs}. This -is accomplished by move constructing the base class, and the contained -\tcode{basic_filebuf}. Next -\tcode{basic_istream::set_rdbuf(\brk{}addressof(sb))} -is called to install -the contained \tcode{basic_filebuf}. +Move constructs the base class, and the contained \tcode{basic_filebuf}. +Then calls \tcode{basic_istream::set_rdbuf(\brk{}addressof(sb))} +to install the contained \tcode{basic_filebuf}. \end{itemdescr} \rSec3[ifstream.assign]{Assignment and swap} -\indexlibrarymember{operator=}{basic_ifstream}% -\begin{itemdecl} -basic_ifstream& operator=(basic_ifstream&& rhs); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Move assigns the base and members of \tcode{*this} from the base and corresponding -members of \tcode{rhs}. - -\pnum -\returns -\tcode{*this}. -\end{itemdescr} - \indexlibrarymember{swap}{basic_ifstream}% \begin{itemdecl} void swap(basic_ifstream& rhs); @@ -10234,7 +10112,7 @@ \begin{itemdescr} \pnum \effects -As if by \tcode{x.swap(y)}. +Equivalent to: \tcode{x.swap(y)}. \end{itemdescr} \rSec3[ifstream.members]{Member functions} @@ -10387,11 +10265,9 @@ \begin{itemdescr} \pnum \effects -Constructs an object of class -\tcode{basic_ofstream}, -initializing the base class with +Initializes the base class with \tcode{basic_ostream(addressof(sb))}\iref{ostream.cons} -and initializing \tcode{sb} with +and \tcode{sb} with \tcode{basic_filebuf()}\iref{filebuf.cons}. \end{itemdescr} @@ -10406,11 +10282,9 @@ \begin{itemdescr} \pnum \effects -Constructs an object of class -\tcode{basic_ofstream}, -initializing the base class with +Initializes the base class with \tcode{basic_ostream(addressof(sb))}\iref{ostream.cons} -and initializing \tcode{sb} with +and \tcode{sb} with \tcode{basic_filebuf()}\iref{filebuf.cons}, then calls \tcode{rdbuf()->open(s, mode | ios_base::out)}. @@ -10429,7 +10303,7 @@ \begin{itemdescr} \pnum \effects -The same as \tcode{basic_ofstream(s.c_str(), mode)}. +Equivalent to: \tcode{basic_ofstream(s.c_str(), mode)}. \end{itemdescr} \indexlibraryctor{basic_ofstream}% @@ -10440,32 +10314,13 @@ \begin{itemdescr} \pnum \effects -Move constructs from the rvalue \tcode{rhs}. This -is accomplished by move constructing the base class, and the contained -\tcode{basic_filebuf}. Next -\tcode{basic_ostream::set_rdbuf(\brk{}addressof(sb))} -is called to install -the contained \tcode{basic_filebuf}. +Move constructs the base class, and the contained \tcode{basic_filebuf}. +Then calls \tcode{basic_ostream::set_rdbuf(\brk{}addressof(sb))} +to install the contained \tcode{basic_filebuf}. \end{itemdescr} \rSec3[ofstream.assign]{Assignment and swap} -\indexlibrarymember{operator=}{basic_ofstream}% -\begin{itemdecl} -basic_ofstream& operator=(basic_ofstream&& rhs); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Move assigns the base and members of \tcode{*this} from the base and corresponding -members of \tcode{rhs}. - -\pnum -\returns -\tcode{*this}. -\end{itemdescr} - \indexlibrarymember{swap}{basic_ofstream}% \begin{itemdecl} void swap(basic_ofstream& rhs); @@ -10490,7 +10345,7 @@ \begin{itemdescr} \pnum \effects -As if by \tcode{x.swap(y)}. +Equivalent to: \tcode{x.swap(y)}. \end{itemdescr} \rSec3[ofstream.members]{Member functions} @@ -10652,14 +10507,10 @@ \begin{itemdescr} \pnum \effects -Constructs an object of class -\tcode{basic_fstream}, -initializing the base class with +Initializes the base class with \tcode{basic_iostream(addressof(sb))}\iref{iostream.cons} -and initializing -\tcode{sb} -with -\tcode{basic_filebuf()}. +and +\tcode{sb} with \tcode{basic_filebuf()}. \end{itemdescr} \indexlibraryctor{basic_fstream}% @@ -10675,14 +10526,10 @@ \begin{itemdescr} \pnum \effects -Constructs an object of class -\tcode{basic_fstream}, -initializing the base class with +Initializes the base class with \tcode{basic_iostream(addressof(sb))}\iref{iostream.cons} -and initializing -\tcode{sb} -with -\tcode{basic_filebuf()}. +and +\tcode{sb} with \tcode{basic_filebuf()}. Then calls \tcode{rdbuf()->open(s, mode)}. If that function returns a null pointer, calls @@ -10702,7 +10549,7 @@ \begin{itemdescr} \pnum \effects -The same as \tcode{basic_fstream(s.c_str(), mode)}. +Equivalent to: \tcode{basic_fstream(s.c_str(), mode)}. \end{itemdescr} \indexlibraryctor{basic_fstream}% @@ -10713,32 +10560,13 @@ \begin{itemdescr} \pnum \effects -Move constructs from the rvalue \tcode{rhs}. This -is accomplished by move constructing the base class, and the contained -\tcode{basic_filebuf}. Next -\tcode{basic_istream::set_rdbuf(\brk{}addressof(sb))} -is called to install -the contained \tcode{basic_filebuf}. +Move constructs the base class, and the contained \tcode{basic_filebuf}. +Then calls \tcode{basic_istream::set_rdbuf(\brk{}addressof(sb))} +to install the contained \tcode{basic_filebuf}. \end{itemdescr} \rSec3[fstream.assign]{Assignment and swap} -\indexlibrarymember{operator=}{basic_fstream}% -\begin{itemdecl} -basic_fstream& operator=(basic_fstream&& rhs); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Move assigns the base and members of \tcode{*this} from the base and corresponding -members of \tcode{rhs}. - -\pnum -\returns -\tcode{*this}. -\end{itemdescr} - \indexlibrarymember{swap}{basic_fstream}% \begin{itemdecl} void swap(basic_fstream& rhs); @@ -10763,7 +10591,7 @@ \begin{itemdescr} \pnum \effects -As if by \tcode{x.swap(y)}. +Equivalent to: \tcode{x.swap(y)}. \end{itemdescr} \rSec3[fstream.members]{Member functions} @@ -10953,8 +10781,7 @@ \begin{itemdescr} \pnum \effects -Constructs the \tcode{basic_syncbuf} object and -sets \tcode{wrapped} to \tcode{obuf}. +Sets \tcode{wrapped} to \tcode{obuf}. \pnum \remarks @@ -10980,10 +10807,6 @@ \end{itemdecl} \begin{itemdescr} -\pnum -\effects -Move constructs from \tcode{other} (\tref{cpp17.moveconstructible}). - \pnum \ensures The value returned by \tcode{this->get_wrapped()} @@ -11068,7 +10891,7 @@ \begin{itemdescr} \pnum -\requires +\expects Either \tcode{allocator_traits::propagate_on_container_swap::value} is \tcode{true} @@ -11556,7 +11379,8 @@ \pnum If the possibility of a file system race would make it unreliable for a program to test for a precondition before calling a function described herein, -\requires is not specified for the function. +% {} on next line suppresses a check failure for a missing newline after \expects. +{}\expects is not specified for the function. \begin{note} As a design practice, preconditions are not specified when it is unreasonable for a program to detect them prior to calling the function. @@ -12439,10 +12263,6 @@ \end{itemdecl} \begin{itemdescr} -\pnum -\effects -Constructs an object of class \tcode{path}. - \pnum \ensures \tcode{empty() == true}. @@ -12506,7 +12326,7 @@ \begin{itemdescr} \pnum -\requires +\mandates The value type of \tcode{Source} and \tcode{InputIterator} is \tcode{char}. @@ -12849,14 +12669,14 @@ \end{itemdecl} \begin{itemdescr} -\pnum -\ensures -\tcode{!has_filename()}. - \pnum \effects Remove the generic format pathname of \tcode{filename()} from the generic format pathname. +\pnum +\ensures +\tcode{!has_filename()}. + \pnum \returns \tcode{*this}. @@ -14859,10 +14679,6 @@ \end{itemdecl} \begin{itemdescr} -\pnum -\effects -Constructs an object of class \tcode{directory_iterator}. - \pnum \ensures \tcode{*this} has the original value of \tcode{rhs}. @@ -14897,7 +14713,6 @@ \end{itemdecl} \begin{itemdescr} - \pnum \effects As specified for the prefix increment operation of @@ -14910,7 +14725,6 @@ \pnum \throws As specified in~\ref{fs.err.report}. - \end{itemdescr} \rSec3[fs.dir.itr.nonmembers]{Non-member functions} @@ -15019,14 +14833,11 @@ \end{itemdecl} \begin{itemdescr} - \pnum \effects Constructs the end iterator. - \end{itemdescr} - \indexlibraryctor{recursive_directory_iterator}% \begin{itemdecl} explicit recursive_directory_iterator(const path& p); @@ -15036,7 +14847,6 @@ \end{itemdecl} \begin{itemdescr} - \pnum \effects Constructs an iterator representing the first @@ -15078,10 +14888,6 @@ \end{itemdecl} \begin{itemdescr} -\pnum -\effects -Constructs an object of class \tcode{recursive_directory_iterator}. - \pnum \ensures \begin{itemize} @@ -15097,10 +14903,6 @@ \end{itemdecl} \begin{itemdescr} -\pnum -\effects -Constructs an object of class \tcode{recursive_directory_iterator}. - \pnum \ensures \tcode{options()}, \tcode{depth()}, @@ -15450,8 +15252,9 @@ \begin{itemdescr} \pnum -\requires At most one element from each option group\iref{fs.enum.copy.opts} - is set in \tcode{options}. +\expects +At most one element from each option group\iref{fs.enum.copy.opts} +is set in \tcode{options}. \pnum \effects @@ -15596,7 +15399,6 @@ file3 \end{codeblock} \end{example} - \end{itemdescr} @@ -15617,7 +15419,6 @@ \pnum \throws As specified in~\ref{fs.err.report}. - \end{itemdescr} \indexlibraryglobal{copy_file}% @@ -15629,9 +15430,10 @@ \begin{itemdescr} \pnum -\requires At most one element from each - option group\iref{fs.enum.copy.opts} is set - in \tcode{options}. +\expects +At most one element from each +option group\iref{fs.enum.copy.opts} is set +in \tcode{options}. \pnum \effects @@ -16469,24 +16271,27 @@ \begin{itemdescr} \pnum - \requires Exactly one of the \tcode{perm_options} constants - \tcode{replace}, \tcode{add}, or \tcode{remove} is present in \tcode{opts}. +\expects +Exactly one of the \tcode{perm_options} constants +\tcode{replace}, \tcode{add}, or \tcode{remove} is present in \tcode{opts}. \pnum - \remarks The second signature behaves as if it had an additional parameter - \tcode{perm_options} \tcode{opts} with an argument of \tcode{perm_options::replace}. +\remarks +The second signature behaves as if it had an additional parameter +\tcode{perm_options} \tcode{opts} with an argument of \tcode{perm_options::replace}. \pnum - \effects Applies the action specified by \tcode{opts} - to the file \tcode{p} resolves to, - or to file \tcode{p} itself if \tcode{p} is a symbolic link - and \tcode{perm_options::nofollow} is set in \tcode{opts}. - The action is applied as if by POSIX \tcode{fchmodat()}. +\effects +Applies the action specified by \tcode{opts} +to the file \tcode{p} resolves to, +or to file \tcode{p} itself if \tcode{p} is a symbolic link +and \tcode{perm_options::nofollow} is set in \tcode{opts}. +The action is applied as if by POSIX \tcode{fchmodat()}. \pnum \begin{note} Conceptually permissions are viewed as bits, but the actual - implementation may use some other mechanism. +implementation may use some other mechanism. \end{note} \pnum