function definition
const circularLinkedList<Tp>& operator=(const circularLinkedList<Tp>& otherList);
lines that cause the error, error message refers to line 327, which starts at nodeType….
template <class Tp>
nodeType<Tp>* circularLinkedList<Tp>&::operator=(const circularLinkedList<Tp>& otherList)
And the error messages from the gcc compiler are:
circularLinkedList.h:327: error: invalid declarator before â&â token
circularLinkedList.h:327: error: expected initializer before â&â token
I assume that I have made some sort of syntax error in in defining this method somewhere. How would I have to go about fixing it? Thanks.
Can you post a little bit more code for us? Can you explain what nodeType is?
The following looks like a function definition:
However, for one thing, the declaration says it returns a
const circularLinkedList<Tp>&.Also, you don’t want to have the
&before the::. It needs to be the type’s name, not a pointer or reference to a variable of that type. If you want that behavior you need to use a proxy class.So it should be something like:
Which should almost invariably end with
return *this;