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.

Example:

// 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
compile.
}


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