Monday, November 1, 2010

PIMPL Idiom

When refactoring a class so that it uses the pimpl (pointer to implementation) idiom, it does not make sense to put the protected members in the pimpl class.

Protected members are meant to be used by derived classes. You cannot get to the protected members if they are in the Impl class to derive from.

Reference: Exceptional C++ by Herb Sutter. Addison-Wesley, 1999, p. 110.

No comments:

Post a Comment