~/talk

On using singletons in C++

Talkat CppCon 2016 · 2016-09-18..09-23· [software-architecture]
links:none on file
slides:none on file

Almost every C++ project uses singletons in one form or another, but the common static-instance pattern exposes internal structures and leaks implementation. Alternatives shown: Pimpl to hide data, an abstract base class with multiple implementations, and a static-method façade. Putting implementation into a namespace with an anonymous namespace keeps internals private but risks the static initialization order fiasco. For testing, either add a test-only reset or place implementation in a detail include so tests can access state.

AI-written summary · about

  1. 0:00Start
  2. 0:56Implementation methods
  3. 1:58Hiding implementation details
  4. 2:38Ease of use
  5. 3:57Testing
~/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.