
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