Boost logo

Boost Users :

Subject: Re: [Boost-users] problem with boost::phoenix::lambda
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-07-25 15:20:22


AMDG

Kim Kuen Tang wrote:
> the following code
>
> double abc=lambda(_a=*ref(it)++)[_a*2.0]()(); // here 'it' is
> an //iterator
>
> produces the error C2440: 'initializing' : cannot convert from
> 'boost::phoenix::detail::error_expecting_arguments' to 'double'
>
> which should not be. The two lines of code
>
> let(_a=*ref(it)++)[_a*2.0](); //or
>
> lambda(_a=*ref(it)++)[_a*2.0*arg1]()( val);
>
> compile fine.
>
> Perhaps someone has an answer to this error?
> ( I use boost trunk version and msvc 2008)
>
> To reproduce the errors just compile the code below.

The problem is that no_nullary doesn't handle local
variables well. Fixing this will require propagating
the variables that are undefined up through every
subexpression.

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net