~/talk

“Function default arguments: Slingshot or Shotgun?”

Talkat CppCon 2017 · 2017-09-24..09-29· [c-and-cpp, software-architecture]
links:none on file
slides:none on file

Function default arguments cause concrete pitfalls: names are bound at declaration, evaluated at call, multiple declarations merge defaults but the first declaration hides previous defaults inside a scope, and default-expression evaluation order is unspecified so two defaults calling next() can produce reversed results. Virtual overrides pick defaults by static type (breaking dynamic dispatch) and templates defer or reject bad default expressions at instantiation. Slides, code and a live demo (mocking and a source_location-style example) live on the conference GitHub and the demo compiles and runs as shown.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 8:42Slingshot or shotgun analogy
  3. 16:09Names bound at declaration evaluated at use
  4. 18:44Multiple declarations and visibility rules
  5. 28:42Member functions and default arguments
  6. 33:50Virtual functions and overrides
  7. 39:16Templates and default arguments
  8. 45:49Alternatives to default arguments
  9. 47:33Library TS and source location
  10. 50:36Constexpr context and runtime behavior
  11. 54:35Virtual dispatch and type identification
  12. 57:08Live demo and conclusion
~/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.