Default argument in the middle of parameter list?

I saw a function declaration in our code that looked as follows

void error(char const *msg, bool showKind = true, bool exit);

I thought first that this is an error because you cannot have default arguments in the middle of functions, but the compiler accepted this declaration. Has anyone seen this before? I'm using GCC4.5. Is this a GCC extension?

The weird thing is, if I take this out in a separate file and try to compile, GCC rejects it. I've double checked everything, including the compiler options used.

52
задан abatishchev 25 May 2011 в 23:04
поделиться