In C++11 (or C++) is it possible to pass a template type that is not fully specified. Specifically, I want to pass a type that does not have all of its template specifiers defined yet:
template <std::size_t N, typename ARRAYTYPE>
struct A {
ARRAYTYPE<int, N> int_array;
};
int main() {
A<10, std::array> my_a;
return 0;
}
I know that simply redefining ARRAYTYPE = std::array<int, 10>
would work, but would not let me utilize an ARRAYTYPE
of different size anywhere in A
:
template <std::size_t N, typename ARRAYTYPE>
struct A {
ARRAYTYPE<int, N> int_array;
ARRAYTYPE<int, 1> tiny_int_array;
};
Is this possible?