~/talk

Thoughts on Curiously Recurring Template Pattern

Talkat C++Now 2019 · 2019-05-05..05-10· [compilers-and-language-design]
links:none on file
slides:none on file

Modern CRTP is presented as a tool for actual code reuse over interface, shown by collapsing repeating inner-loop code across several widget implementations into a single template pattern. Several surprising compile-time behaviors appear: returning CRTP types, using auto with CRTP, and the compiler needing complete size information before deriving. Practical rules emerge: hide static_casts, use concepts not base class and keep implementation classes in an impl namespace, prefer defaults, avoid protected data members, and use a sentinel + is_same pattern to recur through middle layers.

AI-written summary · about

  1. 0:00Introduction
  2. 1:00Hot Take
  3. 2:00CRTP
~/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.