This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

egcs 971031 template operator<< instantiation


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;
}










Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]