Internal compiler error

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Sun Jan 30 02:30:00 GMT 2000


> Please send me feedback on how to get operator<< to work for struct
> Pair.

Thanks for your bug report. Although this is certainly a bug in the
compiler, I believe this is also a bug in your code.

> template<class key,class value>
> template<class key2,class value2>
> ostream& operator<<(ostream& ls, const Pair<key2,value2>& rs)
> {
>   ls << rs.k << '\t' << rs.v;
>   return ls;
> }

The template arguments key and value are not needed, are they? If you
remove the first line, g++ compiles your code just fine.

Regards,
Martin



More information about the Gcc-bugs mailing list