Skip to content

Implement LWG-3571 and LWG-3570: flush_emit set badbit if the emit call fails - #2418

Merged
Stephan T. Lavavej (StephanTLavavej) merged 18 commits into
microsoft:mainfrom
fsb4000:fix2396
Mar 17, 2022
Merged

Implement LWG-3571 and LWG-3570: flush_emit set badbit if the emit call fails#2418
Stephan T. Lavavej (StephanTLavavej) merged 18 commits into
microsoft:mainfrom
fsb4000:fix2396

Conversation

@fsb4000

@fsb4000 Igor Zhukov (fsb4000) commented Dec 14, 2021

Copy link
Copy Markdown
Contributor

Fixes #2396

Fixes #2395

@fsb4000
Igor Zhukov (fsb4000) requested a review from a team as a code owner December 14, 2021 14:26
Co-authored-by: Michael Schellenberger Costa <mschellenbergercosta@gmail.com>
@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) added the LWG Library Working Group issue label Dec 15, 2021
Comment thread stl/inc/ostream Outdated
@fsb4000 Igor Zhukov (fsb4000) changed the title Implement LWG-3571: flush_emit set badbit if the emit call fails Implement LWG-3571 and LWG-3570: flush_emit set badbit if the emit call fails Dec 15, 2021
@fsb4000

This comment has been minimized.

Comment thread stl/inc/syncstream Outdated
Comment thread stl/inc/ostream Outdated
Co-authored-by: Matt Stephanson <stephanson.matt@gmail.com>
Co-authored-by: Matt Stephanson <stephanson.matt@gmail.com>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment thread stl/inc/syncstream Outdated
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks, this looks solid! The only things I noticed were stylistic nitpicks, so I went ahead and pushed a merge with main followed by those trivial changes, after validating that the relevant tests still pass.

Comment thread stl/inc/syncstream
if (!_Ok) {
_State |= ios_base::badbit;
} else {
_TRY_IO_BEGIN

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

God I really don't like these, it's pre-existing (and changing it would be ... a project) so don't consider this a change request, but maybe we should open an issue.

Igor Zhukov (fsb4000) and others added 2 commits March 10, 2022 17:12
Co-authored-by: Charlie Barto <chbarto@microsoft.com>
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks - I approve of the ternary-to-if change that Charlie Barto (@barcharcraz) requested, as if this test ever fails, the asserting line will indicate what was expected - same as the rationale for preferring assert(is_cute()); assert(is_fluffy()); assert(is_kitten()); on separate lines instead of assert(is_cute() && is_fluffy() && is_kitten());.

@barcharcraz Charlie Barto (barcharcraz) removed their assignment Mar 12, 2022
@StephanTLavavej

Copy link
Copy Markdown
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for syncing the implementation with the Standard's stream of LWG issues! 😹 🚀 🎉

@fsb4000
Igor Zhukov (fsb4000) deleted the fix2396 branch March 17, 2022 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LWG Library Working Group issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LWG-3571 flush_emit should set badbit if the emit call fails LWG-3570 basic_osyncstream::emit should be an unformatted output function

5 participants