What do I need to fill in at xxxxx to make this program run?
except use using test_function = void(T::*)(Args...,...);
, is there another way to make the program run.
I don't know if there is a type that can represent ...
.
template<typename T, typename ...Args>
using test_function = void(T::*)(Args...);
class myclass {
public:
void test(const char* format, ...) {
char buffer[MAX_PATH];
va_list args;
va_start(args, format);
int size = _vsnprintf_s(buffer, MAX_PATH, MAX_PATH , format, args);
va_end(args);
std::cout << buffer << std::endl;
}
};
int main()
{
myclass mc;
myclass* mcp;
mcp = &mc;
test_function<myclass, const char*, xxxxx> test_func = &myclass::test;
(mcp->*test_func)("test:%d", 100);
}