Boost logo

Boost :

Subject: Re: [boost] Proposed new RAII Library
From: Andrew Sandoval (sandoval_at_[hidden])
Date: 2012-09-14 20:44:16


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk