Boost logo

Boost :

From: Steven Watanabe (steven_at_[hidden])
Date: 2007-08-20 16:08:17


AMDG

Giovanni Piero Deretta <gpderetta <at> gmail.com> writes:

> > The problem is that ScopeExit relies on local structs which can't
> > be used in templates.
> >
> > If you look at Implementation section ( http://tinyurl.com/2gerqy )
> > you'll notice params_1_t and scope_exit_body_t local structures.
> >
> > Though, I see how it can be avoided: (void*) new params_1_t(...).
> >
>

The local structs are not essential. You can
use tuples.

I too would definitely like to see something like

int main() {

int i = 0;

BOOST_LOCAL_FUNCTION(f, (i), (int, v)) {
    i = v;
} BOOST_LOCAL_FUNCTION_END;

f(2); // i = 2

}

In Christ,
Steven Watanabe


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