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 in partial specialization?

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





PostPosted: Sat Nov 20, 2004 6:20 pm    Post subject: template in partial specialization? Reply with quote



Hi,
is it possible to have a template in a partial specialization? i want to
partialize a template by itself:

template <class PaintPolicy, class Base = window_base>
struct background_wnd : ...
{
};


template <class P, class B>
template <class PaintPolicy>
struct background_wnd<background_wnd : ...
{
};


i know it doesn't work (else i wouldn't post here Wink) but i hope you got
the idea what i want. i hope it's only a syntactical problem and it is
indeed possible somehow in c++

--
mfg Steven

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





PostPosted: Sun Nov 21, 2004 4:56 am    Post subject: Re: template in partial specialization? Reply with quote




"steven11" <steven11 (AT) gmx (DOT) de> wrote

Quote:
Hi,

is it possible to have a template in a partial specialization?

It's definitely possible (and common) for one of the tempalte arguments in a
partial specialization itself to be a template specialization.

Quote:
i want to
partialize a template by itself:

I don't understand.

Quote:
template <class PaintPolicy, class Base = window_base
struct background_wnd : ...
{
};


template template struct background_wnd : ...
{
};

Is this what you're after:

template<class PaintPolicy, class Window>
struct background_wnd { };

template<class PaintPolicy, class P, class B>
struct background_wnd<PaintPolicy, background_wnd { };

?

This is certainly legal.

Jonathan



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


Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.