
15 Sep
2012
15 Sep
'12
12:44 a.m.
Lorenzo Caminiti <lorcaminiti <at> gmail.com> writes:
No, it won't because with C++11 you can execute *arbitrary* copy at scope exit while with bind you can execute a function with arbitrary arity but still just execute a function a scope exit. How do I state this more clearly?? Well say with bind you can't do:
if (...) { f(); int x = 1; } else {...} for (...) ...
(Phoenix might help but that's like trying to use lamba expressions on C++03.)
I think you are misunderstanding me. I'm not saying it will work as a lambda. I'm saying that RAIIFunction will work with boost::bind / std::tr1::bind. In other words, it is useful in C++03, not just C++11. -Andrew Sandoval