It also compiles if you change:
void doJohn( John & j1){ int i=j1.a; }
to
void doJohn(class John & j1){ int i=j1.a; }
This trick works for 'struct' so I gave it a try with 'class' and it worked. Probably works with 'enum', too.
It also compiles if you change:
void doJohn( John & j1){ int i=j1.a; }
to
void doJohn(class John & j1){ int i=j1.a; }
This trick works for 'struct' so I gave it a try with 'class' and it worked. Probably works with 'enum', too.