Partial specialization ambiguity resolution

J

Jon Slaughter

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<T1, T2> >
// : TL::TypeAtNonStrict<Typelist<T1,T2>, 1, NullClass >
{
sTree<I-1, Typelist<T1,T2> > 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<T1,T2> > List; is of the
template or its specialization.

The exact error is:

c:\documents and settings\jon\my documents\visual studio
2005\projects\typelist\typelist\test.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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,271
Latest member
BuyAtenaLabsCBD

Latest Threads

Top