C
Christian Christmann
Hi,
I need a template list where I can store pointers to
different objects. The list consists of linked objects
of the class Element which contain the pointer information.
How do I define the template class Element in the header file?
template <class T> class Element
{
T* info;
...
}
or
template <class T*> class Element
{
T* info;
...
}
And let's say I want to store pointers to an object Node.
What is the right initialization in the source code:
....
Node *newNode;
Element<Node> = new Element<Node>
or
Node *newNode;
Element<Node*> = new Element<Node*> ?
Thanks
Chris
I need a template list where I can store pointers to
different objects. The list consists of linked objects
of the class Element which contain the pointer information.
How do I define the template class Element in the header file?
template <class T> class Element
{
T* info;
...
}
or
template <class T*> class Element
{
T* info;
...
}
And let's say I want to store pointers to an object Node.
What is the right initialization in the source code:
....
Node *newNode;
Element<Node> = new Element<Node>
or
Node *newNode;
Element<Node*> = new Element<Node*> ?
Thanks
Chris