This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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@gcc.gnu.org>
>A :  <gcc-bugs@gcc.gnu.org>,  <gcc-prs@gcc.gnu.org>,  <nobody@gcc.gnu.org>,  <picaud.vincent@wanadoo.fr>
>Copie à :
>Objet : Re: c++/9380: nested template problem for methods without argument : parsing error
>
> Synopsis: nested template problem for methods without argument : parsing 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?cmd=view%20audit-trail&database=gcc&pr=9380
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]