Is it possible to do mixing of types and nontypes in variadic template parameters? If I were to pass a std::array
for instance to this class as parameter T
, I would need to also pass a type for the array and a length, but the way I tried it below causes an error when encountering a value, because it only expects types for Types
:
template <
template<class, std::size_t> class T,
class ... Types>
class C {
T<Types...> storage;
};
int main(){
C<std::array, int, 3> c;
}
Error message:
error: template argument for template type parameter must be a
type
Container<std::array, int, 3> c;
^
Is there a way to pass types and values in a variadic context?