Daily bit(e) of C++ | non-type template arguments
Daily bit(e) of C++ #473, Non-type template arguments in C++11, C++17 and C++20.
Besides types, templates can also be parametrized using non-type arguments from a limited set of structural types.
In C++11, the selection was limited to integral types, enumerations and pointers/references to global objects.
C++17 introduced a syntactic change, allowing auto to be used instead of a concrete type.
Finally, C++20 added support for floating-point types and literal class types (that only have public members and are recursively structural).
The argument is available in the template scope as a constant object. A prvalue for non-class types (except for lvalue reference); for class types, the argument is considered a static storage duration object.