~/talk

for_each_adjacent<N>

Talkat C++Now 2018 · 2018-05-06..05-11· [c-and-cpp]
links:none on file
slides:none on file

Implements a compile‑time sized loop called for_each_adjacent<N> that invokes a callable on each N‑tuple of consecutive elements (works for N=1,2,3 and beyond), uses C++17 features like std::apply and if constexpr to pack N elements into a tuple while preserving references and proxies, and falls back to a much simpler C++14-style implementation using integer_sequence and std::get. The implementation compiles and runs on examples, prints the expected sequences and generalizes adjacent algorithms.

AI-written summary · about

  1. 0:00Start
  2. 1:22for_each_pair v1.0
  3. 1:57for_each_three
  4. 2:41for_each_adjacentsN v1.0
  5. 4:30for_each_adjacent v2.0
~/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.