Hi All,
I am trying to understand the implementation of mpl::vector. I have
simplified greatly to help understand it. I am now trying to figure
out how to represent an empty sequence. Here is what I have got:
template <class T0>
struct vector1
{
typedef vector1 type;
};
template
struct vector2
{
typedef vector2 type;
};
template
struct vector3
{
typedef vector3 type;
};
struct dummy;
template <class T0 = dummy, class T1 = dummy, class T2 = dummy>
struct vector;
template<T0>
struct vector : vector1<T0> {};
template
struct vector : vector2 {};
template
struct vector : vector3 {};
Examples:
vector1<char>::type
vector2::type
vector3::type
vector<char>::type
vector::type
vector::type
How to declare and make use of an empty sequence?
Rgds,
anna
--
Flow: For Love of Water
http://missingrainbow.blogspot.com/2008/09/flow-for-love-of-water.html