Boost logo

Boost :

Subject: Re: [boost] lambda compile error
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-03-18 13:36:06


AMDG

On 03/18/2011 10:03 AM, Andy Venikov wrote:
> 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:
>

What's the error? It works for me with msvc 10 and the trunk.

> #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?

In Christ,
Steven Watanabe


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