Apr 17, 2009 at 3:13pm UTC
Hi,
I have a class mentioned below
template<class TYPE, class ARG_TYPE = const TYPE&>
class SampleList
{
public:
struct Node
{
Node* pNext;
Node* pPrev;
TYPE data;
};
Node * NewNode(Node& pPrev, Node& pNext);
};
template<class TYPE, class ARG_TYPE>
Node * SampleList<TYPE, ARG_TYPE>::NewNode(Node& pPrev, Node& pNext)
{
//My code goes here
//returning node pointer here
}
When I try to complile the code I keep on getting a compliation error as below
error C2143: syntax error : missing ';' before '*'
When I try to return and int or void it gets compiled successfully...I am new to templates Am i doing anything wrong?
Please help,
Thanks in Advance,
M
Apr 17, 2009 at 4:12pm UTC
Just in case, could you please indicate which line the error is called on?