Hi,
so recently I was starting out on a new simple project in C++ and I was thinking about an overall structure on how to organize my code in a proper way.
At this point modules came to my mind. The main point here is that I don't know how to properly seperate the implementation from the interface so that no implementation details of module Y are exposed to module X that is using module Y. Unfortunately C++ does not support modules in a native way because header files do serve as a class definition and interface at the same time...
So I already read about the pimpl idiom and I can see its advantages but there are also some drawbacks in using it (e.g. dynamic memory allocation).
All this is leading to the important question(s):
How do you handle this topic within your projects?
Do you know some techniques beside pimpl to achieve a clean separation between the interface and the implementation? If yes, how do they work and are they field-proven?
Do you know of some open source code that handles this topic quite well? (for further investigation)
Thank you in advance.