Title
operator>>(basic_istream&&, T&&) returns basic_istream&, but should probably return basic_istream&&
Status
resolved
Section
[istream.rvalue]
Submitter
Richard Smith

Created on 2015-05-08.00:00:00 last changed 49 months ago

Messages

Date: 2020-11-09.00:00:00

[ 2020-11-09 Resolved for C++20. Status changed: Tentatively Resolved → Resolved. ]

Date: 2020-02-14.11:24:43

[ 2020-02 Resolved by the adoption of 1203 in Prague. ]

Date: 2017-02-02.00:41:18

[ 2015-06, Telecon ]

JW: think this needs proper consideration, it would make

stream() >> x >> y >> z
go from 3 operator>> calls to 6 operator>> calls, and wouldn't prevent dangling references (change the example to auto&&)

Date: 2015-05-08.00:00:00

Consider:

auto& is = make_istream() >> x; // oops, istream object is already gone

With a basic_istream&& return type, the above would be ill-formed, and generally we'd preserve the value category properly.

History
Date User Action Args
2020-11-09 22:09:58adminsetmessages: + msg11596
2020-02-14 11:24:43adminsetmessages: + msg11115
2020-02-14 11:24:43adminsetstatus: new -> resolved
2015-09-27 20:30:23adminsetmessages: + msg7549
2015-05-08 00:00:00admincreate