In article <11************ **********@z14g 2000cwz.googleg roups.com>,
Greg <gr****@pacbell .net> wrote:
Jacques Labuschagne wrote: Victor Bazarov wrote: > "error". Which error? Does your compiler just say "error" or
> does it actually try to explain what it thinks is wrong?
My compiler could certainly have been more helpful, IMHO. GCC 3.3 says
foo.cc:12: error: parse error before `&' token
It was good enough for me, but I can understand PengYu's confusion.
But imagine the compiler's confusion to run into the "typename" keyword
in what it thought was going to be a method declaration. At that point
the compiler has no idea what the programmer is trying to write, so it
has no idea which part of the expression the programmer should remove.
You told it typename. It is believe you:
"ComeauTest .c", line 17: error: a class or namespace qualified name is required
void doit(typename B<T> &b){//error
(as per the rules of typename) or it doesn't.
--
Greg Comeau / Celebrating 20 years of Comeauity!
Comeau C/C++ ONLINE ==>
http://www.comeaucomputing.com/tryitout
World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?