Passing Object to function

PeterH:

johnwasser:
It also compiles if you change:

I wasn't aware that worked too. Does it implicitly declare 'class John;'?

I suspect it just provides enough context for the compiler to make a valid forward reference. If later the type "John" was declared as something else (struct John, or typedef int John) the compiler would likely complain.