Boost logo

Boost :

From: Phil Nash (phil.nash.lists_at_[hidden])
Date: 2003-02-20 09:10:35

[Anthony Williams]
> I agree. It would be nice to have a generic RAII framework that went
> ScopeGuard, and allowed for all the ownership semantics associated with
> various forms of smart pointer, whilst permitting the resource itself to
> something quite distinct from a pointer.
> If the framework utilized a policy-based design, then you could supply
> policies that extended the interface, so your generic RAII class looked
like a
> smart pointer when the resource it owned was indeed a pointer. It would
> allow for additional not-at-all-pointer-like interfaces to be added for
> case where the resource was something else which had a clear-cut interface
> that was desirable.

Precisely :-)
I think a big obstacle at the moment is the lack of typedef templates.
Without these the important smart_ptr specialisation/ partial instantiation
becomes a little more awkward. However I think this awkwardness can be
contained to the implementation (which can be substituted to the cleaner
design when template typedefs are available). See the earlier threads in the
PBSP discussion (esp. about 6 or 7 months back) for ways this can be

I may have missed out on interest when I brought this up before because I
insisted that smart_resource be separate and parallel to smart_ptr, whereas
I agree that it is more natural for smart_ptr to be subset of

Maybe this turn of the thread should be promoted to its own so that the PBSP
community at large has more visibility of it? I don't know how many of the
usual contributors to those threads are busy with release-oriented duties at



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