Skip to content

Commit ffb23d0

Browse files
Dawn Perchikzygoloid
authored andcommitted
LWG1203 More useful rvalue stream insertion
Merged with P1721R2, which also converted the Remarks: element to a Constraints: element, but with a more consistent wording pattern.
1 parent 68f753c commit ffb23d0

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

source/iostreams.tex

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5548,21 +5548,23 @@
55485548

55495549
\indexlibrarymember{operator>>}{basic_istream}%
55505550
\begin{itemdecl}
5551-
template<class charT, class traits, class T>
5552-
basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&& is, T&& x);
5551+
template<class Istream, class T>
5552+
Istream&& operator>>(Istream&& is, T&& x);
55535553
\end{itemdecl}
55545554

55555555
\begin{itemdescr}
55565556
\pnum
55575557
\constraints
5558-
The expression \tcode{is >> std::forward<T>(x)} is well-formed when treated as an unevaluated operand.
5558+
The expression \tcode{is >> std::forward<T>(x)} is well-formed
5559+
when treated as an unevaluated operand and
5560+
\tcode{Istream} is publicly and unambiguously derived from \tcode{ios_base}.
55595561

55605562
\pnum
55615563
\effects
55625564
Equivalent to:
55635565
\begin{codeblock}
55645566
is >> std::forward<T>(x);
5565-
return is;
5567+
return std::move(is);
55665568
\end{codeblock}
55675569
\end{itemdescr}
55685570

@@ -6759,22 +6761,24 @@
67596761

67606762
\indexlibrarymember{operator<<}{basic_ostream}%
67616763
\begin{itemdecl}
6762-
template<class charT, class traits, class T>
6763-
basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>&& os, const T& x);
6764+
template<class Ostream, class T>
6765+
Ostream&& operator<<(Ostream&& os, const T& x);
67646766
\end{itemdecl}
67656767

67666768
\begin{itemdescr}
67676769
\pnum
67686770
\constraints
6769-
The expression \tcode{os << x} is well-formed when treated as an unevaluated operand.
6771+
The expression \tcode{os << x} is well-formed
6772+
when treated as an unevaluated operand and
6773+
\tcode{Ostream} is publicly and unambiguously derived from \tcode{ios_base}.
67706774

67716775
\pnum
67726776
\effects
67736777
As if by: \tcode{os << x;}
67746778

67756779
\pnum
67766780
\returns
6777-
\tcode{os}.
6781+
\tcode{std::move(os)}.
67786782
\end{itemdescr}
67796783

67806784

0 commit comments

Comments
 (0)