[Boost-bugs] [Boost C++ Libraries] #5690: intrusive_ptr detach method

Subject: [Boost-bugs] [Boost C++ Libraries] #5690: intrusive_ptr detach method
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-07-12 15:22:40

#5690: intrusive_ptr detach method
 Reporter: nn-mail@… | Owner: pdimov
     Type: Patches | Status: new
Milestone: To Be Determined | Component: smart_ptr
  Version: Boost 1.47.0 | Severity: Optimization
 Keywords: intrusive_ptr |
 It is very handy.
 In some cases like passing between threads or between functions.

 (e.g. Boost.ASIO needs this too)

 Instead of writing this code:

 intrusive_ptr<A> a(get_a());


 One could write

 intrusive_ptr<A> a(get_a());


 The good thing in the second variation that we don't increase counter, so
 no 'lock' opcode to the processor. Better performance.

         void* detach()
                 T * tmp = px;
                 px = 0;
                 return tmp;


Ticket URL: <https://svn.boost.org/trac/boost/ticket/5690>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC