24 August, 2007

C++ Template Class Static Member Declartion

template
class list
{
public:
class node
{
private:
public:

T data;
node *next;
};
private:
static node *pool;
};

How to declare static member "pool"?
template list::node *list::pool; --> incorrect!
template (typename | class ) list::node *list::pool; --> correct!

it is a little weird and very unfriendly... If I use "class" keyword to declare, I would be confuse by myself...

No comments: