~/lightning

Lightning Talk: To Flush or Not to Flush? - That Is the Question

Lightningat C++ on Sea 2025 · 2025-06-23..06-25· [software-architecture]
links:none on file
slides:none on file

Writes a simple file example that fails against /dev/null and reveals that ofstream destructor flush hides errors, so programs can report success when flush actually failed. Shows a real outage where writing then renaming produces a partially formed file because rename guard that atomically publishes mixes finalization with cleanup. Builds a scope-based guard, wrestles with returning non-copyable PR values, avoids throwing from destructors by disarming the guard in a try/catch, and ends with a working pattern.

AI-written summary · about

~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.