Section: 184.108.40.206 [istream], 220.127.116.11 [istream.unformatted] Status: NAD Submitter: Steve Clamage Opened: 1998-10-13 Last modified: 2016-02-10
Priority: Not Prioritized
View all other issues in [istream].
View all issues with NAD status.
In 18.104.22.168, class basic_istream has a member function sync, described in 22.214.171.124, paragraph 36.
Following the chain of definitions, I find that the various sync functions have defined semantics for output streams, but no semantics for input streams. On the other hand, basic_ostream has no sync function.
The sync function should at minimum be added to basic_ostream, for internal consistency.
A larger question is whether sync should have assigned semantics for input streams.
Classic iostreams said streambuf::sync flushes pending output and attempts to return unread input characters to the source. It is a protected member function. The filebuf version (which is public) has that behavior (it backs up the read pointer). Class strstreambuf does not override streambuf::sync, and so sync can't be called on a strstream.
If we can add corresponding semantics to the various sync functions, we should. If not, we should remove sync from basic_istream.
A sync function is not needed in basic_ostream because the flush function provides the desired functionality.
As for the other points, the LWG finds the standard correct as written.