What's the execution sequence of phoenix::lambda function?
I'm a newbie for boost phoenix, I wrote a small piece of code but it totally confuses me about the execution sequence, you can check the code ------------------clip----------------- std::vector<int> v; v.push_back(1); ph::for_each(v, ph::lambda[ph::ref(cout)<<"a", ph::ref(cout)<<"b" ])(v); ph::for_each(arg1, ph::lambda[ph::ref(cout)<<"a", ph::for_each(v, ph::lambda[ph::ref(cout)<<"b", ph::ref(cout)<<"c" ]), ph::ref(cout)<<"d" ])(v); ------------------------clap-------------------------- The first output is "ab" but the second output is "dbca". It seams ph::for_each is lazy evaluate , but what is the correct one to make it execute from left to right? thanks -- 半亩薄田一头牛 老婆孩子热炕头
participants (1)
-
饭桶