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 > Re: question to...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 9497 of 9830
Post > Topic >>

Re: question to understand templates

by "Bo Persson" <bop@[EMAIL PROTECTED] > Apr 14, 2008 at 12:53 PM

Bharath wrote:
> Dear all,
> I'm trying learn templates concept.
>
> Here is a line of code from Bjarne Strustrup's C++ programming
> language 3rd edition:
>
> template<class C> struct String<C>::Srep
>
> I couldn't understand what the above line of code means. I'm
> expecting "struct/class <name>" after template<class C>. What
> exactly String<C>::Srep mean? Does "String" refer to STL's string
> template?

No, that would be string or std::string - names are case sensitive.

Here String<C>::Srep is the name of a struct, likely declared inside
some example String class. It would be found in a defintion outside of
the class, like

template<class C>
struct String<C>::Srep
{
    // contents of Srep goes here
};


Bo Persson


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




 3 Posts in Topic:
question to understand templates
Bharath <tiromarch08@[  2008-04-14 10:43:12 
Re: question to understand templates
"Bo Persson" &l  2008-04-14 12:53:06 
Re: question to understand templates
=?ISO-8859-1?Q?Daniel_Kr=  2008-04-14 13:13:16 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Fri Jul 25 15:30:40 CDT 2008.