Vector to Array
summary
Shows how C++20 constexpr std::vector lets a multi-pass algorithm that previously produced a heap-allocated vector become a compile-time constant copied into a std::array, using template parameters to extract the size and contents. Applies to porting a real-time guitar cabinet emulator from a Raspberry Pi to a Pico with 512 KB RAM, eliminating runtime allocations and fitting static buffers. Adds a generic invocable auto lambda variant to accept any constexpr range. Tested with a Pico-capable compiler and it works.
AI-written summary · about
related talks
01h 02mC++20 - My Favorite Code Examples
01h 02mBack to Basics: Almost Always Vector
01h 05mC++11 in the Wild: Techniques from a Real Codebase
23mFunctional Programming in C++ (Run time vs Compile time types)
01h 07mVariadic and Variable Templates in C++14
06mLightning Talk: Making Friends With CUDA Programmers (please constexpr all the things)
01h 10mThe Three Little Dots and the Big Bad Lambdas
59mCombining C++17 Features
