~/lightning

Lightning Talk: Dependency Injection for Modern C++

Lightningat CppCon 2022 · 2022-09-11..09-16· [frontend-architecture]
links:none on file
slides:none on file

Argues that taking functions as parameters replaces heavy interface-and-mocking setups and shows concrete code: pass a std::function into an Optimizer/cost function instead of an abstract class, use a lambda injection in production and trivial lambdas in tests, and even swap to a function pointer for extra simplicity. Tests shrink to one-line fakes, complex object state never needs construction, and existing code needs only a few small signature changes to work.

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.