65,189
社区成员




template <int I> class Test
{
union Obj
{
union Obj *next;
char data[1];
};
static Obj* freeList[16];
};[code]
这用下面的方法初始化freeList:
[code=C/C++]template <int I>
union Test<I>::Obj* Test<I>::freeList[16] = { 0 };
template <int I>
class Test
{
public:
union Obj
{
union Obj *next;
char data[1];
};
static Obj* freeList[16];
};
template <int I>
typename Test<I>::Obj* Test<I>::freeList[16] = { 0 };
template <int I>
class Test
{
public:
union Obj
{
union Obj *next;
char data[1];
};
static Obj* freeList[16];
};
template <int I>
Test<I>::Obj* Test<I>::freeList[16] = { 0 };
template <int I> class Test
{
union Obj
{
union Obj *next;
char data[1];
};
static Obj* freeList[16] = {0};
};