
10 Jul
2009
10 Jul
'09
6:58 a.m.
"fmingu"
After your advice,I wrote the following test program: int main(int argc, char *argv[]) { int nnumber=7; int switchvalue=1; if_then_else(var(nnumber)==6, var(switchvalue)=3 ,var(switchvalue)=30); std::cout<<" the nnumber is "<
the value in the lambda expression did not saved. Can you tell me why?
if_then_else only creates and returns a lambda function object.
And How can I correct it?
You need to apply it (note invoking the fn call operator): if_then_else(var(nnumber)==6, var(switchvalue)=3 ,var(switchvalue)=30)(); HTH / Johan