Hiding Implementation with PIMPL
Hide implementation details behind a pointer-to-implementation idiom.
The PIMPL Idiom
PIMPL = "Pointer to IMPLementation." Move the class s private data to a separate impl struct, accessed via a pointer.
Why PIMPL?
Benefits:
- Hide implementation details from headers
- Reduce compile-time dependencies
- Maintain ABI stability when adding private members
- Allow swapping implementations
All lessons in this course
- Header-Only vs Compiled Libraries
- API Versioning and ABI Stability
- Hiding Implementation with PIMPL
- Writing a Modern Header-Only Utility Library