So far the best solution I've found is the "pimpl"/"cheshire cat" pattern, but it's cumbersome and sometimes problematic. Isn't there a better way of doing this or is just one of those neat little things that we all get to struggle with?
I want to have a sort of 'wall of implementation' that separates the portable side of my code from the system-dependent side. Apart from forward declaring a struct for the private members (pimpl pattern) all I can think of (and this makes me very afraid) is to have the 'real' class inherit from a virtual base that only has the public members, then a factory function could instantiate the derived class and return a pointer to the base (Would that result in clipping when it's deleted? I really don't want to do it like this.
Anyway, I was just curious what methods other people use for this kind of thing. Any advice would be greatly appreciated.






