This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19188] friend funtion inside a template class seems to have a problem
- From: "max656 at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Dec 2004 07:41:05 -0000
- Subject: [Bug c++/19188] friend funtion inside a template class seems to have a problem
- References: <20041229134715.19188.max656@hotmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From max656 at hotmail dot com 2004-12-30 07:41 -------
Thanks for the reply.
In this one line of code
tstack<T>::link* p;
"tstack<T>::link " is a typename. so I can not give another name.
Actually, I got other ways to get around this problem.
But I am interested in this style as well.
The code I am experimenting came from Bruce Eckel's old book.
The 2nd edtion uses a different way from this.
Anyway the definition of "tstack<T>::link" is not created inside the class. it
is used only to declare a private pointer variable named "head".Actually it is
NOT defined. I think that's why g++ (GCC) 3.2.3 20030502 give the warning of
"implicite typename". But a new version, g++ 3.4.1, checks it out and send out a
error message of "../14/tstack.h:68: error: expected `;' before '*' token". I
don't have any idea of what this means. It does not make any sense at all.
Would you take a look at it and reply to me ?
I really appreciate it in advance.
Tyson
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19188