[C++]: support #34 for generated classes akin to Java codec.