Templates or the standard library
Mumit Khan
khan@xraylith.wisc.edu
Sun Sep 6 15:38:00 GMT 1998
"Bruce Eckel" <Eckel@crestedbutte.net> writes:
> There's a problem here with either the template implementation or the
> standard library. This compiles with KCC, BC++ 5.3 and even VC++ 6, but not
> egcs 2.91.57 (it's a little confusing to know if this is 1.1 because of the
> differing version numbers -- is there some way to tell? My 1.1 installation
> was successful but it's hard to know if I'm actually using that or an old
> one).
YACMT (Yet Another Case of Missing ``Typename'') ;-)? See the line
marked with <<<<< down below. I didn't try to compile it, but that
might be the problem.
[ .... ]
template<class Cont, class PtrMemFun>
void apply(Cont c, PtrMemFun f) {
typename Cont::iterator it = c.begin(); // <<<<< HERE
while(it != c.end()) {
(it->*f)();
it++;
}
}
[ .... ]
Regards,
Mumit
More information about the Gcc-bugs
mailing list