On Tue, Mar 23, 2010 at 6:02 PM, Ovanes Markarian
<om_boost@keywallet.com> wrote:
Hi!
This one works...
#include <boost/lambda/lambda.hpp>
#include <boost/lambda/bind.hpp>
#include <boost/lambda/construct.hpp>
#include <algorithm>
#include <vector>
struct A
{
A(int) {}
void f()const {}
};
int main( )
{
using namespace boost::lambda;
std::vector< int > v;
std::for_each( v.begin( ), v.end(), bind(&A::f, bind<A>(constructor<A>(), _1)));
}
It does indeed, making method f() const fixes it, but I still can't quite see why. Without the
constness of f() the guts of the error says this,