Understanding pImpl pattern trade-offs
Incorporating the pImpl pattern into production code has both benefits and disadvantages. Let’s review each so that we can better understand the circumstances that may warrant deploying this pattern.
The negligible performance issues encompass most of the disadvantages. That is, nearly every request made of the target (interface) class will need to be delegated to its nested implementation class. The only requests that can be handled by the outer class will be those not involving any data members; those circumstances will be extraordinarily rare! Another disadvantage includes slightly higher memory requirements of instances to accommodate the added pointer as part of the pattern implementation. These issues will be paramount in embedded software systems and those requiring peak performance, but relatively minor otherwise.
Maintenance will be a little more difficult for classes employing the pImpl pattern, an unfortunate disadvantage...