Q: without the “friend” keyword, how do you support “dump” output like q(cout<<myDog<<endl), where
Dog myDog; // has private fields
Note you can modify Dog class implementation.
%%A: add const pointers to private fields, so the non-friend q(operator<<) can print them.
%%A: change Dog from a class to a struct.
A: c++ reflection is harder than java. Probably overkill here.