4 ms·
PIMPL means "pointer to implementation" and the reason you and your colleagues are having difficulty with it is because you don't understand it, and therefore s
by hellofunk 10y ago
PIMPL means "pointer to implementation" and the reason you and your colleagues are having difficulty with it is because you don't understand it, and therefore should not be using it, or, investing the time to understand it before trying to use it.
>every class has its own .cpp and .h file
Wrong. There are so many high-quality and widely-used libraries that are "header only".
>When I do any of these tricks, find that someone else later comes and makes a changes that introduces the extra #includes after all.
It is possible to write sloppy code in any language, and also to receive low-quality contributions from anyone else to your code. This is not unique to C++. That's why it is important that everyone in a team be on the same page about how code is organized.
>I am referring to writing a base class in the header and then doing the actual implementation in a derived class visible only inside one .cpp file.
This is not the PIMPL idiom, though it is halfway right.