Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #3675
| From | "crea" <no@invalid.com> |
|---|---|
| Newsgroups | comp.lang.c++ |
| References | <f5zpp.27551$rF.22899@newsfe12.ams2> <90nudcFeeiU16@mid.individual.net> <ebApp.12935$tp6.2103@newsfe25.ams2> <io6t1k$v7f$1@dont-email.me> |
| Subject | Re: One template solution I know, but... |
| Message-ID | <rnDpp.1139$_c3.403@newsfe26.ams2> (permalink) |
| Organization | virginmedia.com |
| Date | 2011-04-14 15:19 +0100 |
"Victor Bazarov" <v.bazarov@comcast.invalid> wrote in message
news:io6t1k$v7f$1@dont-email.me...
> On 4/14/2011 6:41 AM, crea wrote:
>> This would definitely work:
>> template<class T> class Data
>> {
>> public:
>> T p;
>> };
>>
>> template<class T> class AA
>> {
>> public:
>> Data<T> m_data;
>> };
>>
>> template<class T> class BB : public AA
>
> 'AA' is missing the template arguments. Won't compile. Did you mean to
> say
>
> template<class T> class BB : public AA<T>
>
> ?
yes, sorry... I did not compile the code, so might have errors.
>
>> {
>> public:
>> };
>>
>> So I could create object like this:
>>
>> AA<int> b;
>> BB<string> b;
>
> You can't create two objects of different types with the same name in the
> same scope.
ye, should be c the other one...
>
>>
>> Ok, this definitely works,
>
> Nope.
after corrections yes.. :)
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-14 10:26 +0100
Re: Simple inheritance-template question Ian Collins <ian-news@hotmail.com> - 2011-04-14 21:51 +1200
Re: Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-14 11:12 +0100
Re: Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-14 11:29 +0100
Re: Simple inheritance-template question Goran <goran.pusic@gmail.com> - 2011-04-14 03:56 -0700
Re: Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-14 12:19 +0100
Re: Simple inheritance-template question Goran <goran.pusic@gmail.com> - 2011-04-14 04:58 -0700
Re: Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-14 13:25 +0100
Re: Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-14 13:38 +0100
Re: Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-14 13:48 +0100
Re: Simple inheritance-template question Goran <goran.pusic@gmail.com> - 2011-04-14 06:06 -0700
One template solution I know, but... "crea" <no@invalid.com> - 2011-04-14 11:41 +0100
Re: One template solution I know, but... Victor Bazarov <v.bazarov@comcast.invalid> - 2011-04-14 09:32 -0400
Re: One template solution I know, but... "crea" <no@invalid.com> - 2011-04-14 15:19 +0100
Re: Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-14 10:59 +0100
Re: Simple inheritance-template question Noah Roberts <dont@email.me> - 2011-04-14 09:29 -0700
Re: Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-15 07:50 +0100
Re: Simple inheritance-template question "crea" <no@invalid.com> - 2011-04-17 17:22 +0100
csiph-web