This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
egcs 971031 template operator<< instantiation
- To: egcs-bugs at cygnus dot com
- Subject: egcs 971031 template operator<< instantiation
- From: colin at field dot medicine dot adelaide dot edu dot au
- Date: Mon, 03 Nov 1997 10:13:49 +1100
- Reply-To: colin at field dot medicine dot adelaide dot edu dot au
Good stuff, guys, it's great to see movement on gcc.
Under linux 2.1.57 egcs snapshot 971031
g++ produces:
undefined reference to operator<<(ostream &, Vector<char> const &)
[note the spurious `const']
on the following text:
#include <stdio.h>
#include <iostream.h>
template <class T>
class Vector
{
friend ostream& operator<< (ostream& out, const Vector<T> & vec);
};
template <class T>
ostream& operator<< (ostream& out, const Vector<T> & vec)
{}
template class Vector<char>;
template ostream& operator<< (ostream& out, const Vector<char> &);
main()
{
Vector<char> vc;
ostream out;
out << vc;
}