Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-02-12 09:21:14

----- Original Message -----
From: "rogeeff" <rogeeff_at_[hidden]>

> P.S. There is one issue (at least) that still is not covered: What if
> I want to extend SmartPtr interface with action that require access
> to both Storage and Ownership policies functionallity. Example: I
> want to add method void aquire() that will aquire for me resource
> from some resource storage (I do not want/need to know where from).
> Now the question is where to put the implemntation. I found that
> there are at least 2 ways to handle it:
> 1. External implementation: Inherit from regular (without custom
> method) smart_ptr and implement it in a child.
> 2. Virtual trick: a) add virtual reset( storage_type& ) = 0; to
> StoragePolicy; b) implement void acquire() as a public part of
> StoragePolicy interface using virtual reset. Though I do not know how
> portable it is.

3. Use a single composite policies parameter which can be built out of all
of the policy components.


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