I am attempting to create a class template that takes an std::array as a template argument. Currently, the declaration is as follows:
template<typename T, std::size_t N, std::array<std::size_t, N> A>
class Foo {
...
}
This is quite unfortunate, however, as I will typically be initializing A with an initializer list, which makes the need to specify N tedious and redundant:
// Current
Foo<int, 3, {5, 3, 4}> bar;
// Preferred
Foo<int, {5, 3, 4}> baz;
I have tried to use something similar to template template parameters to no avail:
template<typename T, template<std::size_t N> std::array<std::size_t, N> A>
Is there a way to accomplish what I'm trying to do, or otherwise 'hide' N by placing it after A in the parameter list?