Here is the .hpp file:
template<typename T>
LinkedQueue<T> operator=(const LinkedQueue<T> & lhs, const LinkedQueue<T> & rhs)
{
m_data = rhs.m_data;
m_next = rhs.m_next;
}
The error says that first line must be a nonstatic member function. Here is the class it is in:
template<typename T>
class LinkedQueue:public AbstractQueue<T>
{
public:
T m_data;
LinkedQueue *m_next;
LinkedQueue<T> operator=(const LinkedQueue<T> & rhs);
LinkedQueue();
void clear();
void enqueue(T x);
void dequeue();
const T& front() const;
bool isEmpty() const;
};
Any idea as to what silly thing I am doing wrong?
You should add a class qualifier to the function definition, and remove the unused
lhsparameter: