草庐IT

InitialArgTypes

全部标签

c++ - 这个程序调用带有参数包的函数指针有什么问题?

根据我的理解,下面的程序显然应该打印:1.0helloworld42但是,它无法编译。为什么?#include#includeusingnamespacestd;templatevoidCallWithExtraParameter(void(*funcPtr)(InitialArgTypes...,int),InitialArgTypes...initialArgs){(*funcPtr)(initialArgs...,42);}voidCallee(doublea,stringb,intc){cout(Callee,1.0,string("helloworld"));}Compile