The type T[]
is an incomplete type, it is known to be an array but the size (which is also part of the type) is unknown at this point. It can be used in some contexts and in those contexts you may want to check whether the variable that is declared as such is an array or not. While the type of the variable is still incomplete the second specialization of std::array
would not match, as the size is unknown.
// test.h
struct Test {
static int data[];
};
// test.cpp
int Test::data[10];
An TU that only includes the header but has no visibility of test.cpp
may want to test whether Test::data
is an array or not.