Subject: Re: [boost] [pimpl] No documentation for pointer semantics
From: Vladimir Batov (vb.mail.247_at_[hidden])
Date: 2014-06-06 08:02:44
Rob Stewart-6 wrote
> On June 6, 2014 4:59:47 AM EDT, Vladimir Batov <
> > wrote:
>>... my offering of pimpl::pointer_semantics and
>>pimpl::value_semantics seems to make sense.
> That's the problem. It isn't the Pimpl Idiom anymore.
Well, that was a few nervous hours when I felt my familiar Pimpl world was
crashing all around me... after looking closely it seems my "extended"
interpretation of Pimpl to still be the Pimpl Idiom. :-) First, Pimpl ==
Handle/Body == Bridge. Now I open GoF pg. 151 -- the Bridge chapter.
The Applicability section -- you want to share an implementation among
multiple objects (perhaps using ref. counting).
The Consequences section -- Hiding implementation details from clients. You
can shield clients from implementation details, like the sharing of
implementor objects and the accompanying ref. counting mechanism (if any).
The Implementation section -- 3. Sharing implementors.
In fact, the Implementation section goes as far as to call one-to-one
relationship between Abstraction and Implementor a degenerate case of the
I.e. Gof sees pimpl::pointer_semantics, a.k.a. "Bridge with Shared
Implementation" to be the proper Bridge when pimpl::value_semantics to be a
degenerate one... although I feel it's a "bridge" :-) to far.
Do I get a cookie? :-)
-- View this message in context: http://boost.2283326.n4.nabble.com/pimpl-No-documentation-for-pointer-semantics-tp4663510p4663562.html Sent from the Boost - Dev mailing list archive at Nabble.com.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk