Boost logo

Boost :

Subject: [boost] lambda compile error
From: Andy Venikov (avenikov_at_[hidden])
Date: 2011-03-18 13:03:59


Hi,
I thought that lambda expressions of the form:

(var(actual_var) = _1)(new_value)

are supposed to work.

Here's a small code that does not compile with boost 1.42 and gcc4.5:

#include <map>
#include <boost/lambda/lambda.hpp>

using namespace std;

void foo()
{
     using namespace boost::lambda;

     typedef multimap<int, int> MP;
     MP mp1;
     MP mp2;

     (var(mp1) = _1)(mp2); //compile-time error here
}

Are standard maps special in that regard?

Thanks,
    Andy.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk