我有类成员方法(省略类定义本身):
template<Severity level, typename...Args>
void print(Args...args){ //VA template print function which calls recursively print_impl
d_policy->lockMutex();
switch(level){
case DEBUG :
d_policy->getBuffer() << "<DEBUG>";
break;
case WARNING :
d_policy->getBuffer() << "<WARNING>";
break;
case ERROR :
d_policy->getBuffer() << "<ERROR>";
break;
}
d_policy->getTime();
print_impl(args...);
}
template<typename First, typename...Rest>
void print_impl(First first, Rest...rest){ //Called by print_impl public method
}
void print_impl(){
}
我陷入了将它包装到boost python中,我看到堆栈溢出中的线程如何包装变量参数函数但是它是不同的野兽:How to expose a c++ function taking variable arguments in boost python,任何帮助都会受到赞赏。