I use the ROOT C++ libraries (root.cern.ch) daily and was browsing the source when I came across this function declaration:
TString TString::Format(const char *va_(fmt), ...)
{
//etc.
It can be found here.
I don't understand how a const char *
can have an argument or a parenthesis in its name.
The expression va_(fmt)
is later used as a simple const char *
even though it looks like a function call or a constructor. At first I thought it had something to do with the variable argument list, which was also new to me, but reading documentation on stdarg.h didn't help with this question at all.
It is very hard to google for help since I'm not really sure what to call this. A declaration with an argument? That doesn't give any good results.
I used to think I knew C++, but what is going on here? All help will be appreciated.
va_
is simply a macro. Probably one that does nothing but expand to its parameter. – Anapest