I am trying to overload an assignment operator in a cpp file for a nested template class.
My header file looks something like this:
template <class T>
class Outer:
private:
// some member variables
public:
/*
* Other functions here
*/
template <class T>
class Inner:
Inner & Inner :: operator = (const Inner & rhs);
I can't, however, figure out what my cpp file should look like. This is what I have:
template <class T>
Outer<T>::Inner<T>:: Inner<T> & Inner<T> :: operator = (const Inner<T> & rhs)
{
// code is here
}
This gives me the error:
Iterator is not a template (C/C++ 864)
on the parts of my code surrounded by *
Outer<T>::Inner<T>::Inner<T> & **Inner<T>** :: operator = (const **Inner<T>** & rhs)
I would rather not make the operator overloads inline if I can avoid it. Help!