Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-09-18 08:54:10

From: "Peter Dimov" <pdimov_at_[hidden]>


> Note that the required counted_base derivation (to support
> is visible only to the translation unit that contains Impl, a translation
> unit that is typically not visible to the client at all.
> Therefore, with this design, shared_from_this is only callable from Impl
> member functions or other implementation details.
> Had it been called shared_from_raw, this would imply that a raw to shared
> conversion is of general utility to the client, and because of the
> counted_base requirement, this would steer users towards design #1,
> something that I don't want to do.
> This is also one of the reasons that I don't want to attempt any
> "optimizations" that depend on the template parameter being-a

Very interesting. I learned something. Haven't done any interface-based
design in quite some time; it's nice to see someone thinking about it so
deeply. I hope you'll add this explanation to the rationale or some other
part of the docs.

           David Abrahams * Boost Consulting
dave_at_[hidden] *

Boost list run by bdawes at, gregod at, cpdaniel at, john at