Named Arguments from Scratch
summary
Live coding builds a small named-arguments library in C++17 using Boost.Hana and Compiler Explorer, showing an adapter that accepts a hana::map of keys to values, extracts a hana::tuple in the required order, and uses hana::unpack to call the function — it compiles and prints the expected result. The demo implements a user-defined literal for argument names and a operator= overload to produce hana::pair entries, discusses perfect forwarding, default-argument handling, and posts the full Argo-based code on GitHub.
AI-written summary · about
chapters (18)
- 0:00Introduction
- 1:43Why do we do this
- 3:33Tools
- 4:30Argument Passing
- 5:56Compiler Explorer
- 8:53Data Structures
- 12:04Extracting Values
- 14:48Refactoring
- 17:13Context for lambda
- 18:49Order of arguments
- 22:29Map
- 25:24Userdefined literal
- 30:27Refactor
- 34:17Adapters
- 41:39Name parameters
- 45:22Why
- 46:39References
- 47:11Questions
related talks
01h 34mMetaprogramming in C++14
01h 08mC++ Metaprogramming: A Paradigm Shift
52mBack to Basics: Lambdas from Scratch
01h 03mHigher order functions for ordinary C++ developers
04mGeneralized fold expressions
05mPostmodern Meta C++
53mC++ Variadic Templates and Parameter Packs
53mC++ Features You Might Not Know
