Re: [Boost-bugs] [Boost C++ Libraries] #6941: ASIO Daytime.3 example misuses enable_shared_from_this

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6941: ASIO Daytime.3 example misuses enable_shared_from_this
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-05-24 22:38:36


#6941: ASIO Daytime.3 example misuses enable_shared_from_this
------------------------------------+---------------------------------------
  Reporter: m_albert137@… | Owner: chris_kohlhoff
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: asio
   Version: Boost 1.49.0 | Severity: Problem
Resolution: | Keywords:
------------------------------------+---------------------------------------

Comment (by steven_watanabe):

 Replying to [ticket:6941 m_albert137@…]:
>
> Perhaps:
> return (new tcp_connection...).shared_from_this()
> ?
>

 That's illegal. shared_from_this only works
 after you've created the initial shared_ptr.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6941#comment:1>
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:09 UTC