This is the mail archive of the gcc@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: template syntax


On Thu, 22 Jul 2004, Marco Correia wrote:
> Could anyone please tell me why this code:

First of all, this code does not even come close to compiling; in the
version that you posted, there is also an #include missing and cout
resides in namespace std.

Second, please note that this list is *not* a support list for GCC,
rather it is dedicated to the development of GCC (as opposed to the
development with GCC).

> void bla()
> {
>     B<T1> v;
>     v.method<int>(3);			// <-- HERE (line 20)
>     v.B<T1>::method<int>(3);	// <-- Also doesn't work
> }

Intuitively, v already has been instantiated with T1; what is <int>
supposed to do here?  method() is just a regular member function of
B, there are no further templates involved here.

Gerald
-- 
Gerald Pfeifer (Jerry)   gerald@pfeifer.com   http://www.pfeifer.com/gerald/


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