“Implementing `static` control flow in C++14"
summary
Shows a working C++14 implementation of compile-time branching and looping that mimics C++17 if constexpr and adds a richer static_for with index, accumulator, break/continue and runtime side effects. Uses generic lambdas, variable templates and integral_constant wrappers, plus the for-args initializer-list trick and recursive lambdas to iterate. Demonstrates examples (consume, compile-time fold, static_for summation), compiles cleanly on GCC/Clang and emits zero-cost runtime assembly at -O, with measurable compile-time cost for recursion.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 0:42Static control flow overview
- 7:06C++14 static if implementation
- 14:57Code examples and demos
- 23:00Compile-time iteration with for ARS
- 36:25Static 4 compile-time loop
- 54:48Implementation details
- 1:00:46Conclusion and Q&A
related talks
01h 02mImplementing `static` control flow in C++14
59mModern C++ for Fun and Profit: This isn’t your old C++
20mC++17 - The Best Features
32mCute C++ Tricks, Part 2 of N: More code you should learn from and never write
01h 35mC++20 – My Favourite Code Examples
55mTemplates Made Easy With C++20
01h 25mComparing 'Classic C++' and 'Modern C++' Ways to Solve Programming Tasks
51mModern techniques for keeping your code dry
