This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofResolved status.
operator>>(basic_istream&&, T&&) returnsbasic_istream&, but should probably returnbasic_istream&&Section: 31.7.5.6[istream.rvalue]Status:ResolvedSubmitter: Richard SmithOpened: 2015-05-08Last modified: 2020-11-09
Priority:3
View all otherissues in [istream.rvalue].
View all issues withResolved status.
Discussion:
Consider:
auto& is = make_istream() >> x; // oops, istream object is already gone
With abasic_istream&& return type, the above would be ill-formed, and generally we'd preserve the value category properly.
[2015-06, Telecon]
JW: think this needs proper consideration, it would make
stream() >> x >> y >> zgo from 3 operator>> calls to 6 operator>> calls, and wouldn't prevent dangling references (change the example to auto&&)
[2020-02 Resolved by the adoption of1203(i) in Prague.]
[2020-11-09 Resolved for C++20. Status changed: Tentatively Resolved → Resolved.]
Proposed resolution: