Boost logo

Boost :

From: Phil Nash (phil.nash.lists_at_[hidden])
Date: 2002-04-29 18:39:01


From: "Sven Van Echelpoel" <sven.vanechelpoel.sv_at_[hidden]>

> So if I were to use Loki::SmartPtr I'd have to create a storage policy
> for each resource type, although they only differ in the function that
> has to be called to destroy the resource. Granted, one could conceive a
> "generic" storage policy that forwards the destruction to the required
> API function, or something similar. But since the storage policy is the
> last template parameter, I'd have to specify all other policies, even
> though I agree with the supplied defaults.
>
> So of course you can use Loki::SmartPtr for all types of resources, it
> is in general impractical for anything that isn't allocated from the
> free store.

This was something I had not thought of initially, but it does illustrate
the different perspectives you approach smart_ptrs from when they are being
used as smart_resources. For smart_resources the open/ close semantics are
much more important than with smart_ptrs (where most of the time we are
probably happy to accept the default of "delete" and we allocate
externally).

Thanks,

[)o
IhIL..


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