Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2642: bug constructing from a reference to another boost::function
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-09-02 03:18:23
#2642: bug constructing from a reference to another boost::function
------------------------------+---------------------------------------------
Reporter: steven_watanabe | Owner: dgregor
Type: Bugs | Status: closed
Milestone: Boost 1.38.0 | Component: function
Version: Boost 1.37.0 | Severity: Problem
Resolution: fixed | Keywords:
------------------------------+---------------------------------------------
Changes (by steven_watanabe):
* status: reopened => closed
* resolution: => fixed
Comment:
This behavior is correct. f2 is not empty. That what it holds happens to
be a reference to an empty boost::function is irrelevant. BTW, before
1.40, you could get a bad_function_call with
{{{
#include <boost/function.hpp>
#include <boost/ref.hpp>
void f() {}
int main() {
boost::function<void()> f1(&f);
boost::function<void()> f2(boost::ref(f1));
f1.clear();
if (f2) {
f2();
}
}
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/2642#comment:4> 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:01 UTC