This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Yet another template bug in gcc-2.95.1
- To: Wolfgang dot Glas at hfm dot tu-graz dot ac dot at
- Subject: Re: Yet another template bug in gcc-2.95.1
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Sun, 29 Aug 1999 13:59:26 +0200
- CC: Peter dot Vanroose at esat dot kuleuven dot ac dot be, gcc-bugs at gcc dot gnu dot org
- References: <37C173AE.B4EE585@esat.kuleuven.ac.be> <37C2510A.9A2F3642@hfm.tu-graz.ac.at>
> The main problem is that the member function operators interact with the
> friend operators although they take different arguments.
Thanks for your bug report. I'm not too sure whether the bug is in
your code or in g++. What exactly is the friend declaration supposed
to declare as a friend? And where in the standard is that supposed to
be supported?
Anyway, a work-around is to write
// now I bring in the friends...
template <class T>
friend
ptrdiff_t operator- (const _r__It <T>& x, const _r__It <T>& y);
template <class T>
friend
_r__It<T> operator+ (ptrdiff_t n,const _r__It <T>& x);
Hope this helps,
Martin