This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++23 status.
3570.basic_osyncstream::emit
should be an unformatted output function
Section: 31.11.3.3 [syncstream.osyncstream.members] Status: C++23 Submitter: Tim Song Opened: 2021-06-19 Last modified: 2023-11-22
Priority: Not Prioritized
View all issues with C++23 status.
Discussion:
basic_osyncstream::emit
seems rather similar to basic_ostream::flush
— both are "flushing" operations that forward to member functions of the streambuf
and set badbit
if those functions fail. But the former isn't currently specified as an unformatted output function, so it a) doesn't construct or check a sentry
and b) doesn't set badbit
if emit
exits via an exception. At least the latter appears to be clearly desirable — a streambuf
operation that throws ordinarily results in badbit
being set.
sentry
and only calls emit
on the streambuf
if the sentry
converts to true
, so this seems to be an accidental omission in the wording.
[2021-06-23; Reflector poll]
Set status to Tentatively Ready after five votes in favour during reflector poll.
[2021-10-14 Approved at October 2021 virtual plenary. Status changed: Voting → WP.]
Proposed resolution:
This wording is relative to N4885.
Modify 31.11.3.3 [syncstream.osyncstream.members] as indicated:
void emit();-1- Effects: Behaves as an unformatted output function (31.7.6.4 [ostream.unformatted]). After constructing a
sentry
object, c Callssb.emit()
. If that call returnsfalse
, callssetstate(ios_base::badbit)
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4