Jon Slaughter Guest
|
Posted: Wed Sep 28, 2005 6:14 pm Post subject: Partial specialization ambiguity resolution |
|
|
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
|
|