it's any possibility to use a variadic parameters with out specification of first one?
For example:
This code is perfectly fine:
void something(const char* layoutAndButton, ...)
{
va_list ap;
va_start(ap, layoutAndButton);
std::map<std::string, std::string> data;
while (*layoutAndButton != '\0') {
std::string layout = va_arg(ap, const char*);
++layoutAndButton;
std::string button = va_arg(ap, const char*);
++layoutAndButton;
data.insert(std::make_pair(layout, button));
}
for (auto const& x : data)
{
std::cout << x.first << ':' << x.second << std::endl;
}
va_end(ap);
}
But I would like to have the something function in this way:
void something(const char*...)
It's any possibility to do something like that? and after that to access the members? if yes, how?
Thanks