Boost logo

Boost :

From: Andrei Alexandrescu (andrewalex_at_[hidden])
Date: 2003-02-04 13:43:04

"Pavel Vasiliev" <pavel_at_[hidden]> wrote in message
> >>I would like to offer for discussion one more implementation of
> > counting smart pointer.<
> > [snip]
> > Howgh!
> > Andrei
> :-) In general, I agree with you. 1024-th smart pointer is 1023-rd
> wheel reinvented. But The Best Wheel is still to be found.
> Nevertheless, thanks for reply, even for the such one.

Obviously you missed the delights of reading Karl May's Winnetou when you
were a kid :o).

> refc_ptr<T> is not a science-intensive implementation like
> Loki::SmartPtr<>. It rather oriented to practical needs.
> The following syntax is employed:
> refc_ptr<U> spU = new shell_xx<U>(args);
> where shell_xx<T> is one of "reference counting shells for objects of
> type T". With some "shells" refc_ptr<T> is the same as
> boost::shared_ptr<T>/weak_ptr<T>, with others - is similar to
> boost::intrusive_ptr<T>, or to shifted_ptr<T>, etc. All with the only
> class refc_ptr<T>; all types of reference counting are almost
> transparent for a client.

Looks great. However, all these behaviors can be, and most were, trivially
implemented as policies of SmartPtr, while benefitting of all the extra
amenities, which all your pointers are lacking.

Seems, however, that I need to refocus my efforts of convincing people that
SmartPtr is the way to go and design within its framework - the kavorka of
implementing one's own pet smart pointer is way too overwhelming :o).


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