from building the source code I get this error, I am not sure what it means from my previous post I got helped and I got further and this is what I have until now, thanks for any help,
main.cpp:31:2: error: no match for 'operator<<' in 'os << (& q)->Queue::PrintQ()'
template<class T> class Queue;
template<class T> ostream& operator<<(ostream& os, Queue<T>& q);
template<class T>
class Queue{
protected:
vector<T> theQ;
public:
void Push(T item);
T pop();
void ReadAnItem();
void PrintQ();
friend ostream& operator<< <T>(ostream& os, Queue<T>& q);
};
template<class T>
ostream& operator<< (ostream& os, Queue<T>& q){
os << q.PrintQ();
return os;
}
template<class T>
void Queue<T>::Push(T item){
theQ.push_back(item);
}
template<class T>
T pop(){
}
template<class T>
void Queue<T>::ReadAnItem(){
T item;
cout << "Enter the data please: " << endl;
cin >> item;
Push(item);
}
template<class T>
void Queue<T>::PrintQ(){
cout << "The content of the array is as follows: " << endl;
for (int i=0; i < theQ.size(); i++){
cout << theQ[i];
cout<< endl;
}
}
class Employee{
protected:
long empId;
string empName;
string email;
public:
Employee(){}
Employee(long i, string n){
empName = n,
empId =i;
email = "Unknown";
}
friend ostream& operator<<(ostream& os, Employee& e){
os << e;
return os;
}
};
class Student{
protected:
long stId;
int year;
string email;
string schoolName;
public:
Student(){}
Student(long i, int y, string sn){
stId = i;
year =y;
email = "Unknown";
schoolName=sn;
}
friend ostream& operator<<(ostream& os, Student& s){
os << s;
return os;
}
};
int main(){
Queue<Student> s;
s.Push(Student(300982, 21, "Andrey"));
cout << s;
return 0;
}