Generic Programming with C++ Template
■ このスレッドは過去ログ倉庫に格納されています
0587VC6に乗せたい
NGNGあのように作り方を明記すると、考えが整理できるものですね。
>>576で載せたテンプレートも、ガイドラインに沿った命名に書き換えました。
template <class TList, unsigned int index,
typename DefaultType = NullType>
struct TypeAtNonStrict
{
template <class tmpTList>
struct tmp2TypeAt
{
template <unsigned int cnt>
struct tmp1TypeAt
{
typedef TypeAtNonStrict<tmpTList::Tail, cnt-1, DefaultType>::Result Result;
};
template <> struct tmp1TypeAt<0>
{
typedef tmpTList::Head Result;
};
typedef tmp1TypeAt<index>::Result Result;
};
template <> struct tmp2TypeAt<DefaultType>
{
typedef DefaultType Result;
};
typedef tmp2TypeAt<TList>::Result Result;
};
このコードで、コンパイル、テスト動作ができることは確認しております。
願わくば、この勢いで TypeList.h で定義されている
テンプレート群をVC6仕様に書き換える作業にご協力願いたい。
正直、一人ではきついので。
■ このスレッドは過去ログ倉庫に格納されています