Is the following code legal in C++?
void f(void* = 0) {} int main() { f(); }
Which page of the C++ standard states that this usage is lega
Not only is it legal, it could actually be quite useful depending on your coding style.
Default parameters are only meaningful in a function declaration.
Named parameters are only meaningful in a function definition.
f.h:
void f(void*=nullptr);
f.cc
void f(void* x) { ... }