Why is it impossible to have a reference to void? The only thing I found in the C++ Standard is this line, at 8.3.2.1
A declarator th
The following is not a defense of the notion of void references. I offer it as an anecdote from the wild. Ask yourself if it doesn't smell funny.
My company was one of the first using C++ commercially, and initially compiled using Cfront. Early developers were still learning the language, and generally using every trick in the book (operators everywhere!). Here is a trick they thought was cool:
void Foo::something(int action, ostream &os = *(ostream *)0)
{
ostream *os_p = &os;
if (&os == (ostream *)0) {
os_p = &cerr;
}
// continue with method
}
So here you have, not a void reference, but rather a typed reference with a potentially void binding! A moment's thought should probably suggest better alternatives to this particular idiom...