struct PrivateFieldsOfMyShinyClass;
struct MyShinyClass {
int somePublicData;
double morePublicData;
struct PrivateFieldsOfMyShinyClass *p;
};
> malloc isn't possible, but neither are copies by value, sizeof() breaksThose are implementation details which are deliberately being hidden.
> Completely incompatible with inlining code.
They are as incompatible with code inlining as public/private modifiers in C++ are. That is, LTO is your best friend here. Also, have you ever tried to maintain binary compatibility with several versions of a third-party C++ library that keeps adding/removing private fields to/from its classes?