~/lightning

Safe bool idiom

Lightningat Meeting C++ 2016 · 2016-11-18..11-19· [rust]
links:none on file
slides:none on file

A small experiment replaces the old safe bool idiom with C++11's explicit operator bool and triggers three concrete breakages: expected loss of implicit conversions, failing comparisons against literal 0 unless operator==(..., nullptr_t) overloads are added, and a surprising third case where returning a pimpl-held testable type no longer converts because return does not perform explicit conversions. A minimal patch compiles client code nowhere — the fix is local casts or API workarounds, so the library keeps the old idiom for compatibility.

AI-written summary · about

  1. 0:00Start
  2. 1:16Without the Safe Bool Idiom struct Testable
  3. 3:21implicit conversions
  4. 3:51comparison against literal 0
  5. 4:58return statements
  6. 5:46Solution: must change the code
~/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.