c++11 constexpr flatten list of std::array into array
I am beginning with c++11, constexpr and template metaprogramming seems a nice way to save scarce ram on tiny microcontroler. Is there a way to write a template to flatten a list of constexpr array, what I need is a way to do : constexpr std::array<int, 3> a1 = {1,2,3}; constexpr std::array<int, 2> a2 = {4,5}; constexpr auto a3 = make_flattened_array (a1,a2); I use gcc 4.8.4 (arm-none-eabi), and can compile with std=c++11 or c++1y option if it is needed. Marco A. Notice - I understood your question as follows: you want to join those two arrays and flatten the result into a single, new array