Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-04-19 07:44:53

From: <DKl_at_[hidden]>
> Personally, I don't care about these details. In fact, I care more about
> having a specific smart pointer type appropriate for a given type 'T':
> For some types 'T' external counters are appropriate for other types 'T'
> intrusive counters are appropriate. *THE* smart pointer should make the
> correct choice.

Respectfully disagree. Second-guessing the programmer is evil. Explicit is
often better.


// some member function

shared_ptr<this_type> f()
    return shared_ptr<this_type>(this); // is this line correct?

Compare with:

shared_ptr<this_type> f()
    return intrusive_ptr<this_type>(this); // either correct, or does not

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