Header file:
#include <iostream>
using namespace std;
template <class A_Type> class Queue
{
public:
Queue(int = 10);
Queue(const Queue<A_Type>&);
~Queue();
Queue& operator=(const Queue&);
bool enqueue(A_Type);
bool dequeue(A_Type&);
bool empty() const;
bool full() const;
bool clear();
A_Type * getData();
bool operator==(const Queue&) const;
friend ostream& operator<<(ostream&, const Queue<A_Type>&);
private:
int max;
int front;
int rear;
A_Type *data;
};
My attempt at declaring the method in Queue.cpp (The error shows up on the first line):
Queue<class A_Type>::Queue(const Queue<A_Type> &q)
{
front = q.front;
rear = q.rear;
max = q.max;
data = new A_Type[max];
data = q.data;
}
Eclipse is throwing the error:
forward declaration of 'class A_Type'
And I'm not really sure what that means nor how to fix it. Any advice or help would be greatly appreciated.
Thank you very much in advance.