Boost logo

Boost :

Subject: Re: [boost] Why no non-null smart pointers?
From: Jeff Hill (johill_at_[hidden])
Date: 2014-04-29 10:44:27


So I deleted the wrong post. This is the version of the proposed change that
I intended to keep.

template < typename T>
void shared_ptr < T > :: reset ( T * p = 0 )
{
    if ( p ) {
          /* what happens in shared_ptr now */
    }
    else {
        /* new behavior in shared_ptr, when it detects a nill raw pointer */
        *this = NullObjectTypes < T > :: factory ();
    }
}

--
View this message in context: http://boost.2283326.n4.nabble.com/Why-no-non-null-smart-pointers-tp2642959p4661818.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

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