3 ms·
It demonstrates a method of generating a family of types or functions that, until C++17, would have required Template Metaprogramming via partial specialization
by ncmncm 6y ago
It demonstrates a method of generating a family of types or functions that, until C++17, would have required Template Metaprogramming via partial specialization or template function overloading, but is now just programming.
The key line is "if constexpr", which is evaluated at compile time and terminates the recursion.