Boost logo

Boost :

From: rogeeff (rogeeff_at_[hidden])
Date: 2002-01-12 10:49:59


--- In boost_at_y..., "David Abrahams" <david.abrahams_at_r...> wrote:
>
>
> > 1. Why the separate Storage and Ownership policies?
> >
> > 2. How are threading issues addressed? I see RefCountedMT but it
doesn't
> > have the proper "template <class> class OwnershipPolicy"
signature so it
> > cannot be used, am I missing something?
> >
> > 3. Why are GetImpl*, Reset, Release free friends and not members?
>
> I can answer the last one. Andrei makes a good argument in MC++D:
>
> class Printer {
> ...
> public:
> Release();
> };
>
> SmartPtr<Printer,...> p(new Printer);
>
> ...
>
> p->Release(); // oops, meant p.Release() !
Yes, but I would make them friends to SmartPtr (instead of
StoragePolicy)and include additional check implemented in
CheckingPolicy in form like OnDirectAccess.

Gennadiy.


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