~/talk

“C++ Metaprogramming: Journey from simple to insanity and back"

Talkat CppCon 2015 · 2015-09-21..09-25· [compilers-and-language-design, c-and-cpp]
links:none on file
slides:none on file

Covers template metaprogramming techniques that generate code at compile time using templates, partial specialization, default template arguments and SFINAE, with practical idioms like remove_pointer and an if_compiles macro that tests arbitrary expressions via overload resolution and sizeof tricks. Shows numeric examples run 2^27 iterations where power 16 takes ~0.5s and power 20 ~0.9s, and a divide‑and‑conquer generation that drops 0.5s to 0.05s. Notes recursion depth limits, when to prefer constexpr, and how these tricks enable portable, self‑adapting code.

AI-written summary · about

  1. 0:00Intro
  2. 2:02What is Metaprogramming?
  3. 2:24Why use metaprogramming?
  4. 7:15Note on C++11 syntax
  5. 7:55Not Tools of metaprogramming
  6. 15:02Compile-time (static) assertions
  7. 24:50Example - computing r with partial specializations
  8. 28:33More practical metaprogramming examples
  9. 29:43Guidelines for using metaprogramming in everyday application programming Compile-time numeric calculations
  10. 30:58Example - bit string
  11. 34:06Indexing bits in a template
  12. 37:16Indexing deque
  13. 40:50Type manipulations
  14. 41:52Life before C++11 was miserable...
  15. 46:00Type-dependent code for efficiency
  16. 49:33Argument non-evaluation
  17. 49:56SFINAE check for a member function
  18. 53:07Back to the drawing board
  19. 54:12Nobody expects global operators!
~/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.