title: c++: shared code across pimpl implementations
body: <p>I am currently writing some code that has to be portable. For that purpose I am using the pimpl idiom since I think it seperates the actual implementations cleanly from the API.
  Anyways, the pimpl idiom only works very great if the implementations don't share code (i.e. some generic functions that are shared across implementations).</p>
  
  <p>The other option would be abstract interfaces i guess.- Anyways since I am using pimpl across my whole project I really don't think it's a good idea to mix it with abstract interfaces (on the API level).</p>
  
  <p>So what options would you suggest to share code across different pimpls? I thought about an abstract interface class for the pimpl itself, so that the actual API is still cleanly separated, but that seems like a weird idea too. </p>
  
  <p>PS: I don't want to discuss if pimpl or abstract interfaces are better. From an API perspective I made the decision to go with pimpl and I'd like to stick with it.</p>