$ cat t.cpp && xlC t.cpp
template <class T>
struct is_unbound_array
{
enum { value = 0 };
};
template <class T, unsigned N>
struct is_unbound_array<T [N]>
{
enum { value = 0 };
};
template <class T>
struct is_unbound_array<T []>
{
enum { value = 1 };
};
extern "C" int printf (const char*, ...);
int main ()
{
#define test(X) printf ("%s = %u\n", #X, X)
test ((is_unbound_array<int>::value));
test ((is_unbound_array<int []>::value));
test ((is_unbound_array<int [2]>::value));
test ((is_unbound_array<int [][2][3][4]>::value));
test ((is_unbound_array<int [2][3][4]>::value));
return 0;
}
"t.cpp", line 15.8: 1540-0403 (S) "template <class T> struct is_unbound_array<T []>" is already defined.
"t.cpp", line 9.8: 1540-0425 (I) "is_unbound_array<T [N]>" is defined on line 9 of "t.cpp".