Re: [Boost-bugs] [Boost C++ Libraries] #12275: bind fwds shared_ptr twice, invokes memfn with nullptr

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12275: bind fwds shared_ptr twice, invokes memfn with nullptr
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-06-17 17:00:37


#12275: bind fwds shared_ptr twice, invokes memfn with nullptr
------------------------------------------+---------------------
  Reporter: Jason Mancini <jayrusman@…> | Owner: pdimov
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: bind
   Version: Boost 1.61.0 | Severity: Problem
Resolution: | Keywords:
------------------------------------------+---------------------

Comment (by Jason Mancini <jayrusman@…>):

 Let's try that code sample again. :^) Slightly adjusted for clarity.

 {{{
 #include <stdio.h>
 #include <boost/shared_ptr.hpp>
 #include <boost/make_shared.hpp>
 #include <boost/bind.hpp>
 #include <boost/function.hpp>

 using namespace boost;
 struct Obj { bool MF() const { printf("this %p\n", this); return true; }
 };
 using tFunc = function<bool(shared_ptr<const Obj>)>;

 int main() {
   shared_ptr<const Obj> sptr = make_shared<Obj>();
   tFunc AA, BB;
   AA = bind(&Obj::MF, _1);
   BB = bind(AA, _1) && bind(&Obj::MF, _1);
   BB(sptr);
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12275#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:20 UTC