PImpl
PIMPL, short for Pointer to IMPLementation, is a C++ design idiom used to separate a class’s interface from its implementation. By moving private data members and implementation details into a separate class and keeping a pointer to that class in the public interface, the header file exposes only the minimal interface while hiding the rest of the implementation.
In a typical PIMPL setup, the public class forward declares an inner or separate Impl class and
Advantages include improved encapsulation, reduced compile times, and the potential for better binary compatibility across library
PIMPL is most beneficial for large, stable interfaces in libraries where compile-time dependencies and binary compatibility