Subject: [Boost-bugs] [Boost C++ Libraries] #3453: Using bind with Boost.Function won't compile
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-09-15 16:54:54
#3453: Using bind with Boost.Function won't compile
-----------------------------------+----------------------------------------
Reporter: junfeng-guo@⦠| Owner: dgregor
Type: Bugs | Status: new
Milestone: Boost 1.41.0 | Component: function
Version: Boost 1.40.0 | Severity: Showstopper
Keywords: |
-----------------------------------+----------------------------------------
Below codes are copied from sample codes in Boost.Bind documentation at
http://www.boost.org/doc/libs/1_40_0/libs/bind/bind.html#with_boost_function,
with a little modification.
It compiles in older version (1.30.0) but fails to compile in newer
version (1.36.0 or newer) and report following error:
\boost/function/function_base.hpp(316) : error C2059: syntax error : '('
\boost/function/function_base.hpp(312) : while compiling class template
member function 'void
boost::detail::function::functor_manager_common<Functor>::manage_small(const
boost::detail::function::function_buffer
&,boost::detail::function::function_buffer
&,boost::detail::function::functor_manager_operation_type)'
I am using MSVC 9.0. Seems there is a bug in the Boost.Function codes.
Here are the test codes:
class button
{
public:
boost::function<void()> onClick;
};
class player
{
public:
void play(){};
void stop(){};
};
button playButton, stopButton;
player thePlayer;
void connect()
{
playButton.onClick = boost::bind(&player::play, &thePlayer);
stopButton.onClick = boost::bind(&player::stop, &thePlayer);
}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3453> 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