~/talk

`for_each_argument` explained and expanded

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

Explains how Sean Parent’s one-line trick expands a parameter pack via an initializer_list-based comma trick to call a callable for each argument, then builds concrete utilities: for_each_argument with guaranteed left-to-right evaluation, a make_vector that uses std::common_type and reserves size, tuple iteration via std::index_sequence and std::apply, and a grouped-arity for_n that batches arguments by R. Code compiles, uses static_assert tests, prints the shown outputs, and C++17 fold expressions replace much of the boilerplate.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 1:04Original for_each_argument explained
  3. 4:19Creating makeVector function
  4. 7:27Compile-time integer sequences
  5. 9:38Iterating over std::tuple elements
  6. 13:28Generalizing for_n_arys
  7. 20:31Implementing make_unordered_map
  8. 26:37C++17 fold expressions overview
  9. 29:29Modernizing for_n_arys with folds
  10. 31:40Q&A and closing
~/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.