0
什麼意思是從類型列表中刪除類型在C++元編程中。任何人都可以提出任何簡單的例子。從類型列表中刪除類型C++元編程
class null_typelist {};
template <class H, class T>
struct typelist
{
typedef H head;
typedef T tail;
};
template<class T1, class T2=null_typelist, class T3=null_typelist, class T4=null_typelist> struct List;
template <class T1, class T2, class T3>
struct List<T1, T2, T3, null_typelist>
{
typedef typelist<T1, typelist<T2, typelist<T3,null_typelist> > > type;
};
template <class H, class T>
class ABC< typelist<H, T> > : public ABC<T>
{
...
};
template <class H>
class ABC< typelist<H, null_typelist> >
{
...
};
struct Elements{};
struct A: Elements{};
struct B: Elements{};
struct C: Elements{};
typedef List<A,B,C>::type MyOBJ;
struct Createobject : ABC<MyOBJ>
{
...
};
int main()
{
Createobject obj;
}
在這種情況下,如果我必須從類型列表中刪除B.是否有可能將其刪除?以及如何我可以刪除類型B.
[鏈接](http://books.google .co.in /書?ID = aJ1av7UFBPwC&PG = PA58&LPG = PA58&DQ =擦除+型+從+α+類型串&源= BL&OTS = YRgDZnTf51&SIG = L_n6EQJeIfQvGhuaZdeNr3_JH1g&HL = EN&SA = X&EI = xZwUUdasAoWKrgfJlYDgCA&VED = 0CDUQ6AEwAQ#v = onepage&q =擦除%20type%20from%20A %20typelist&F =假) – 2013-02-08 06:37:24