我在C++ 11中创建了一个lua绑定。我想在可变参数模板中处理每种类型。访问各种类型的可变参数模板
我在想我可以做这样的事情,除了使用Params...
代表它内部的所有类型,而不是像它的可变参数函数那样,它内部的下一个单一类型。
template <class T, typename ReturnType, typename... Params>
struct MemberFunctionWrapper <ReturnType (T::*) (Params...)>
{
static int CFunctionWrapper (lua_State* luaState)
{
for(int i = 0; i < sizeof...(Params); i++)
{
//I want to get the next type, not all of the types
CheckLuaValue<Params...>();
//Do other stuff
}
}
};
我该怎么做呢?
呵呵? 。 。 。 。 。 。 –