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 

Partial specialization ambiguity resolution

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Jon Slaughter
Guest





PostPosted: Wed Sep 28, 2005 6:14 pm    Post subject: Partial specialization ambiguity resolution Reply with quote




struct NullClass { void Null() { } };

template <unsigned int i, typename T>
struct Node
{
enum {I = i};
typedef T Class;
};




template <unsigned int I, class NodeList>
struct sTree
{
sTree<I-1, NodeList> List;
void Base() { };
};


template <unsigned int I, class T1, class T2>
struct sTree<I, Typelist
// : TL::TypeAtNonStrict<Typelist
{
sTree<I-1, Typelist List;
void End() { };
};

template <typename NodeList>
struct sTree<0, NodeList>
{
void End() { };
};



In the above code I get an error on the specialization of Typelist type
because it can't figure out if sTree<I-1, Typelist List; is of the
template or its specialization.

The exact error is:

c:documents and settingsjonmy documentsvisual studio
2005projectstypelisttypelisttest.cpp(45) : error C2752:
'sTree<I,NodeList>' : more than one partial specialization matches



I don't have a clue what it means by "more than one" because I only have 2
and the other one doesn't match at all... unless it is calling the template
itself a partial specialization?

Any ideas?



Thanks, Jon


Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) 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.