
Hi all,
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.
Best regards
Kim Tang
# include <algorithm>
# include <vector>
# include

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

Hi Steven, thank you for your answer. I will create a ticket and try to find a fix for this issue. Do you have some recommendation where to begin? Best regards, Kim Tang Steven Watanabe schrieb:
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

AMDG Kim Kuen Tang wrote:
I will create a ticket and try to find a fix for this issue. Do you have some recommendation where to begin?
Grep for no_nullary. All instances will need to be changed to sets of undefined variables, the test to determine whether a default constructor is needed will have to check for an empty set. mpl::or_ will need to be replaced with a set union, and the scope constructs will need to do a set difference with the local variables that they define. In Christ, Steven Watanabe
participants (2)
-
Kim Kuen Tang
-
Steven Watanabe