Below code extracts n-th argument of function formatted as string. How can I implement it without providing the second function? Is it possible at all?
template <typename Type, typename ...Args>
static std::string getArgument(unsigned argumentIndex, Type value, Args... args)
{
if (argumentIndex != 0)
return getArgument(argumentIndex - 1, args...);
else
return std::to_string(value);
}
static std::string getArgument(unsigned argumentIndex)
{
return std::string();
}