
On May 31, 2016 5:56:29 PM EDT, Josh Juran <jjuran@gmail.com> wrote:
On May 31, 2016, at 5:10 PM, Emil Dotchevski <emildotchevski@gmail.com> wrote:
On Tue, May 31, 2016 at 12:09 PM, Chris Glover <c.d.glover@gmail.com> wrote:
I sometimes don't pimpl an entire object. This might be because I have templates in the interface or because I need the functions to inline. Your solution doesn't allow me to do that.
One possibility is to use inheritance in the cpp file:
header:
struct foo { int critical_; };
cpp:
namespace { struct foo_: foo { int not_so_critiral_; }; }
Since this uses a derived class instead of a pointer, I've been calling this the "dimpl" idiom. :-)
I like the name. It's a nice play on Herb's "Pimpl". ___ Rob (Sent from my portable computation engine)