Boost logo

Boost :

Subject: Re: [boost] Boost 1_58_0_b1_rc2 is available for testing
From: Peter Dimov (lists_at_[hidden])
Date: 2015-03-14 17:51:45

Marcel Raad wrote:
> I get a lot of compile errors on MSVC12 when using boost::bind with more
> than two arguments of which one is a non-const reference and constructing
> a boost::function with the result:
> #include <boost/bind.hpp>
> #include <boost/function.hpp>
> void a(int&, int, int);
> int main(){
> boost::function<void(int&, int, int)>
> f(boost::bind(&a, _1, _2, _3));
> }
> results in
> error C2664: 'void (int &,int,int)': cannot convert argument 1 from 'const
> int' to 'int &'

Good one.

This regression is caused by the following change to boost::function:

You can verify that by adding

#include <boost/config.hpp>

at the top of the source file.

An example that doesn't use boost::bind is:

int main()
    boost::function<void(int, int, int)> f2( &a );

This, too, worked before the change and doesn't now.

Boost list run by bdawes at, gregod at, cpdaniel at, john at