J
James Aguilar
Hello, all.
I saw this in the provided code of a lab that I have due in a couple of
weeks in my algorithms class. It compiled fine in g++ but did not compile
with the VC++ compiler. It does not recognize the angle brackets that
follow "<<" in the operator friend declaration.
--- CODE ---
template <class T> class PriorityQueue {
....
friend std:stream &operator<< <> (std:stream &, PriorityQueue &);
}
template <class T>
std:stream &operator<<(std:stream &os, PriorityQueue<T> &q)
{
os << "not implemented yet\n";
return os;
}
--- END CODE ---
Is this code standard? If so, how do you suggest I get around the weakness
in the VC++ compiler? If not, how should I write this?
Sincerely,
James
I saw this in the provided code of a lab that I have due in a couple of
weeks in my algorithms class. It compiled fine in g++ but did not compile
with the VC++ compiler. It does not recognize the angle brackets that
follow "<<" in the operator friend declaration.
--- CODE ---
template <class T> class PriorityQueue {
....
friend std:stream &operator<< <> (std:stream &, PriorityQueue &);
}
template <class T>
std:stream &operator<<(std:stream &os, PriorityQueue<T> &q)
{
os << "not implemented yet\n";
return os;
}
--- END CODE ---
Is this code standard? If so, how do you suggest I get around the weakness
in the VC++ compiler? If not, how should I write this?
Sincerely,
James