I'm learning about data structures by making a simple card game. In this code, i have a class Player, and a Queue containing all the players in the game.
the implementation of the Queue:
template < typename T >
class Queue{
int count;
int front, rear;
T entry[maxsize];
public:
Queue();
bool empty();
errorcode Append(T item);
errorcode serve();
errorcode retreive(T &item);
};
The Queue constructor:
template <typename T>
Queue<T>::Queue(){
count = 0;
rear = maxsize-1;
front=0;
}
And here is the Player class:
class Player {
int number;
List<string> set;
public:
Player(int number, List<string> set) {
this->number = number;
this->set = set;
}
void draw();
string play();
.
.
.
};
in the main function, i declare the Queue using this code:
Queue<Player> pl;
But i get the error 'no matching function for call to Player::Player()', this error is in the line where the queue constructor is implemented.