[lambda] Lambda bind and upgrading

Hello all,
In the process of upgrading Boost from 1.39.0 to 1.46.1 I encountered a
few problems with Boost.Lambda. Some places where I used bind and
operator== are not compiling anymore with Visual Studio 2008 SP1. Here's
a self-contained example showing the problem:
---------------------
#include <algorithm>
#include <vector>
#include

AMDG On 04/04/2011 08:26 AM, Swerts, Benjamin wrote:
In the process of upgrading Boost from 1.39.0 to 1.46.1 I encountered a few problems with Boost.Lambda. Some places where I used bind and operator== are not compiling anymore with Visual Studio 2008 SP1. Here's a self-contained example showing the problem:
Bother. I thought I fixed this.
--------------------- #include<algorithm> #include<vector> #include
#include using boost::lambda::bind; using boost::lambda::_1; struct A { unsigned int id; }; struct B { const A* a; };
int main() { const std::vector<B> vb; std::find_if(vb.begin(), vb.end(), bind(&A::id, bind(&B::a, _1)) == 2); return 0; } ---------------------
- This code compiles fine with Boost 1.39.0 - When compiled with Boost 1.46.1 it shows the following error:
boost_1_46_1/boost/lambda/detail/function_adaptors.hpp(280) : error C2440: 'return' : cannot convert from 'const unsigned int' to 'unsigned int&'
In Christ, Steven Watanabe

AMDG On 04/04/2011 08:26 AM, Swerts, Benjamin wrote:
In the process of upgrading Boost from 1.39.0 to 1.46.1 I encountered a few problems with Boost.Lambda. Some places where I used bind and operator== are not compiling anymore with Visual Studio 2008 SP1. Here's a self-contained example showing the problem:
...and apparently, I did fix it. Your code compiles with the current release branch, so this will be fixed for 1.47. In Christ, Steven Watanabe

AMDG
On 04/04/2011 08:26 AM, Swerts, Benjamin wrote:
In the process of upgrading Boost from 1.39.0 to 1.46.1 I encountered a few problems with Boost.Lambda. Some places where I used bind and operator== are not compiling anymore with Visual Studio 2008 SP1. Here's a self-contained example showing the problem:
...and apparently, I did fix it. Your code compiles with the current release branch, so this will be fixed for 1.47.
In Christ, Steven Watanabe
OK, thanks a lot for the check. I'll wait for 1.47 then. Greets, Ben
participants (2)
-
Steven Watanabe
-
Swerts, Benjamin