I have a function as
AddSprintf(char* , ... )
I want to make compile time error if somebody is calling it without two arguments.
Currently if somebody is calling like
AddSprintf("hello")
it works. But I want to disable calling like this.
Is there any way using g++ I can force passing of argument ?
Overload AddSprintf:
Then you get a weird error message when compiling
AddSprintf("hello")But keep in mind that with C++11 you should use variadic templates because they are typesafe.