Vector to Array - Robin Savonen Söderholm - Meeting C++ 2025 @MeetingCPP
Vector to Array - Robin Savonen Söderholm - Meeting C++ 2025  @MeetingCPP
Uploaded December 2025 | Updated November 2026, 54 minutes ago
Robin shows how to preserve compile time allocations with std::vector into an std::array in constexpr context in C++ in his lightning talk from Meeting C++ 2025.

This talk presents a C++20 technique for converting dynamic, heap-allocated data structures into static, compile-time constants suitable for constrained embedded environments. The speaker, motivated by porting a real-time audio cabinet emulator from a Raspberry Pi to a Raspberry Pi Pico, faced the challenge of an algorithm that produces a `std::vector` whose final size is not trivially known. The solution leverages the `constexpr` capabilities of `std::vector` in C++20. By making the vector-generating function `constexpr` and its parameters template arguments, the entire computation is shifted to compile-time. This allows for the creation of a `std::array` with the exact size and contents of the computed vector, completely eliminating the need for runtime dynamic memory allocation. A more generic refinement using a lambda is also presented.
Vector to Array - Robin Savonen Söderholm - Meeting C++ 2025Meeting C++ 2025 is 8 weeks away!Iterate and Improve to give better talks - Robert Schimkowitsch- Speaking about C++ 2025C++ in Embedded Systems - Interview with Author Amar MahmutbegovićGuy Davidson on Reflection - the big C++26 feature(Dont) use coroutines for this - Ivan Čukić - Meeting C++ 2025Modern CMake for C++ - interview with the authorMastering C++ Game Animation Programming - Interview with Author Michael Dunsky (GameDev)The Code is Documentation Enough - Tina Ulbrich - Meeting C++ 2025Interview with Alex Dathskovsky - Unlocking the Value of C++20 Features - Meeting C++ 2025Asynchronous Programming with C++ - interview with the authorsWhen to copy instead of move -  threads & containers
Meeting Cpp |

Vector to Array - Robin Savonen Söderholm - Meeting C++ 2025

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER