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]

Re: Internal compiler error


> 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


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