C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

template template specialization

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
chokidar
Guest





PostPosted: Fri Sep 24, 2004 3:43 pm    Post subject: template template specialization Reply with quote



Hello,

I get an error on Visual Studio 7.1 when I try to compile the
following code:

1 template <class T>
2 struct DerivedFrom {
3 typedef Nulltype Base;
4 };
5
6 template <template
7 struct DerivedFrom<Derived {
8 typedef Nulltype Base;
9 };

(7) : error C2065: 'T' : undeclared identifier
(9) : error C2953: 'DerivedFrom<Derived>' : template class has already
been defined
(9) : see declaration of 'DerivedFrom<Derived>'
(9) : error C2753: 'DerivedFrom<Derived>' : partial specialization
cannot match argument list for primary template

Basically, I want DerivedFrom to work for template classes as well as
regular classes. Is this even possible?

Thanks,
Hasan.

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

Back to top
Ben Hutchings
Guest





PostPosted: Sat Sep 25, 2004 10:23 am    Post subject: Re: template template specialization Reply with quote



chokidar wrote:
Quote:
Hello,

I get an error on Visual Studio 7.1 when I try to compile the
following code:

1 template <class T
2 struct DerivedFrom {
3 typedef Nulltype Base;
4 };
5
6 template