I\'m aware that sizeof...(Args...)
yields the number of types in a C++0x packed template argument list, but I wanted to implement it in terms of other features
Konrad's answer should get you going, but I think the more idiomatic way such things are usually expressed is with static member constants, so I just wanted to present that solution:
#include
template struct arg_size; // no primary definition needed
template struct arg_size
: public std::integral_constant::value> { };
template <> struct arg_size<>
: public std::integral_constant { };
Then you get your argument pack size via arg_size
.