Hi, I got a problem. I try to do something like this.
struct Foo
{
const char *anything;
};
class Test2
{
public:
static Foo aFoo2[];
};
Foo Test2::aFoo2[] =
{
{ "1" },
{ "2" },
};
int main()
{
int size = sizeof( Test2::aFoo2 );
}
but on template class.
I've tried code like below but it giving "illegal sizeof operand" error.
struct Foo
{
const char *anything;
};
template<class T>
class Test
{
public:
static Foo aFoo[];
};
template<class T>
Foo Test<T>::aFoo[] =
{
{ "1" },
{ "2" },
};
int main()
{
int sizeT = sizeof( Test<int>::aFoo ); // error
}
Thanks.