[Boost-bugs] [Boost C++ Libraries] #2642: bug constructing from a reference to another boost::function

Subject: [Boost-bugs] [Boost C++ Libraries] #2642: bug constructing from a reference to another boost::function
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-01-08 01:52:49


#2642: bug constructing from a reference to another boost::function
-----------------------------+----------------------------------------------
 Reporter: steven_watanabe | Owner: dgregor
     Type: Bugs | Status: new
Milestone: Boost 1.38.0 | Component: function
  Version: Boost 1.37.0 | Severity: Problem
 Keywords: |
-----------------------------+----------------------------------------------
 The following code throws a bad_function_call exception
 because the constructor for f2 decides that since f1 is
 empty, f2 ought to be empty as well.

 {{{
 #include <boost/function.hpp>
 #include <boost/ref.hpp>

 void f() {
 }

 int main() {
     boost::function<void()> f1;
     boost::function<void()> f2(boost::ref(f1));
     f1 = f;
     f2();
 }
 }}}

 The attached patch fixes the problem.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2642>
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:49:59 UTC