c++/9380: nested template problem for methods without argument : parsing error

Vincent PICAUD PICAUD.VINCENT@wanadoo.fr
Wed Jan 22 10:56:00 GMT 2003


The following reply was made to PR c++/9380; it has been noted by GNATS.

From: "Vincent PICAUD" <PICAUD.VINCENT@wanadoo.fr>
To: <lerdsuwa@gcc.gnu.org>,
 <gcc-bugs@gcc.gnu.org>,
 <gcc-prs@gcc.gnu.org>,
 <nobody@gcc.gnu.org>,
 <picaud.vincent@wanadoo.fr>,
 <gcc-gnats@gcc.gnu.org>
Cc:  
Subject: Re: c++/9380: nested template problem for methods without argument : parsing error  
Date: Wed, 22 Jan 2003 11:51:09 +0100 (MET)

 Thank you very much for your valuable explanations... 
 I apologise for my mistake... I didn't know this C++ syntax : "a.template=
  how_many<Vertex>();"
 Now all work fine and thanks to you I can continue to develop my code.
 Regards,
 
 -- Vincent Picaud.
 
 
 >Messsage du 21/01/2003 14:15
 >De :  <lerdsuwa@gcc.gnu.org>,  <gcc-bugs@gcc.gnu.org>,  <gcc-prs@gcc.gnu=
 .org>,  <nobody@gcc.gnu.org>,  <picaud.vincent@wanadoo.fr>,  <gcc-gnats@gc=
 c.gnu.org>
 >A :  <gcc-bugs@gcc.gnu.org>,  <gcc-prs@gcc.gnu.org>,  <nobody@gcc.gnu.or=
 g>,  <picaud.vincent@wanadoo.fr>
 >Copie =E0 : 
 >Objet : Re: c++/9380: nested template problem for methods without argume=
 nt : parsing error  
 >
 > Synopsis: nested template problem for methods without argument : parsin=
 g error
 > 
 > State-Changed-From-To: open->closed
 > State-Changed-By: lerdsuwa
 > State-Changed-When: Tue Jan 21 14:15:05 2003
 > State-Changed-Why:
 >     Not a bug.  Your code inside 'foo_2':
 >       a.how_many<Vertex>();
 >     'a' depends on the template parameter 'dim' so the compiler
 >     doesn't know if 'how_many' is a variable, a type, or a
 >     template.  For example, you can declare a specialization
 >       template<> class A<Volumn> { int how_many; }
 >     Then 'A<Vertex>.how_many' is a template function but
 >     'A<Volumn>.how_many' is a variable.  
 >     
 >     When you are referring to a template when the context is 
 >     template parameter dependent, you need the 'template' 
 >     keyword as in:
 >       a.template how_many<Vertex>();
 >     The same applies to the example in the Fix section:
 >       a.template how_many<Vertex>(id_foo<Vertex>());
 > 
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl=3Fcmd=3Dview%20audit-trail&datab=
 ase=3Dgcc&pr=3D9380
 > 
 



More information about the Gcc-prs mailing list