Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > templates in te...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 8 Topic 9744 of 9938
Post > Topic >>

templates in templates

by stephan.ohl@[EMAIL PROTECTED] Jun 25, 2008 at 06:16 PM

Hi,

   I've the following code:

// declaration of a class template
template <typename T>
class SomeClass;

// definition of a specialisation
template <>
class SomeClass<AType> {

     // definition of a member function template
     //   in the specialisation of 'SomeClass'
    typename <typename U>
    int func(int i);

}

And now how do I declare the member function template (of a
specialised class template)?
It worked under VS just via appending the body ( ... int func(int i)
{ U::var v = 42; }  ) but with
gcc it doesn't compile. It says something like ';' expected before
v ...

Can anyone please explain that to me?
;-) Stephan

-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 8 Posts in Topic:
templates in templates
stephan.ohl@[EMAIL PROTEC  2008-06-25 18:16:28 
Re: templates in templates
huili80@[EMAIL PROTECTED]  2008-06-26 03:36:25 
Re: templates in templates
Sarang <sarangbaheti@[  2008-06-26 03:44:35 
Re: templates in templates
Greg Herlihy <greghe@[  2008-06-26 03:57:56 
Re: templates in templates
Ruki <waruqi@[EMAIL PR  2008-06-26 13:12:38 
Re: templates in templates
stephan.ohl@[EMAIL PROTEC  2008-06-26 13:27:34 
Re: templates in templates
stillman <luc.touraill  2008-06-27 14:18:21 
Re: templates in templates
Greg Herlihy <greghe@[  2008-06-27 14:27:59 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Aug 27 20:51:55 CDT 2008.