Boost logo

Boost :

Subject: Re: [boost] Pimpl Again?
From: Rob Stewart (rstewart_at_[hidden])
Date: 2016-06-01 04:49:37


On May 31, 2016 5:56:29 PM EDT, Josh Juran <jjuran_at_[hidden]> wrote:
>On May 31, 2016, at 5:10 PM, Emil Dotchevski <emildotchevski_at_[hidden]>
>wrote:
>
>> On Tue, May 31, 2016 at 12:09 PM, Chris Glover <c.d.glover_at_[hidden]>
>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)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk