20 Mar
2015
20 Mar
'15
4:21 p.m.
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
#include void a(int&, int, int);
int main(){ boost::function
f(boost::bind(&a, _1, _2, _3)); } results in error C2664: 'void (int &,int,int)': cannot convert argument 1 from 'const int' to 'int &'
Thank you, Marcel, for reporting this. I added a test in https://github.com/boostorg/bind/commit/b4881265fbe2100211a7ffb734ce2aaa0d00... and then fixed it in https://github.com/boostorg/bind/commit/42b5cef177603328ead66bc6a98a3067aebc... Would appreciate if you give this change a try and see if it has any unwanted consequences.