~/talk

Meandering Through C++ Creating ranges::to

Talkat CppNorth 2024 · 2024-07-21..07-24· [compilers-and-language-design]
links:none on file
slides:none on file

Walks through a homemade ranges::to implementation that uses Concepts, if constexpr, and CRTP to pick between initialization/copy and in-place insertion; builds a range adapter type inheriting from range_adaptor_closure so the adapter can be a pipeline endpoint. Code compiles on GCC 13.2, 14.0 and Clang 18.1 under C++23, handles vectors and nested containers, solves copy issues for most containers with an emplace-based trick, but still needs special handling for sets, stacks and queues.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 7:58What is ranges::to and why it matters
  3. 17:53Solving the copy vs in-place dilemma
  4. 24:45Understanding ranges and sentinels
  5. 33:48Handling nested ranges and type deduction
  6. 37:04CRTP and range adapter implementation
  7. 42:07Testing pipelines with std::tuple
  8. 44:16Q&A and closing remarks
~/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.