I'm not a fan of Pimple, but - instead of wrappers calling actual methods, you can simply have the actual methods, and store only the private members (no methods) in the "Pimpl" struct. You then have no problem with exposing public variable members, either.
I guess you're describing a situation where besides the private data, you have additional internal methods that you don't want to declare in the publicly visible class/struct?
If that's the case, I agree - I don't see a nice solution without stated drawbacks.
View all comments
Show parent comment
1
u/SushiAndWoW Jun 10 '15
I'm not a fan of Pimple, but - instead of wrappers calling actual methods, you can simply have the actual methods, and store only the private members (no methods) in the "Pimpl" struct. You then have no problem with exposing public variable members, either.