where to place default value parameter in variable-length function in c++?
问题 in variable-length parameters function, the '...' must be place last. And default value enabled parameters must be last, too. so, how about both needed in the same one function? Now I have a log utility: void MyPrint(int32_t logLevel, const char *format, ...), which used to print log according to 'logLevel'. However, sometimes I hope it can be used as: MyPrint("Log test number%d", number), without 'logLevel' needed. The question: Default arguments and variadic functions didn't help. 回答1: In