Boost logo

Boost :

From: Alexander Nasonov (alnsn_at_[hidden])
Date: 2007-11-27 12:48:21


John Torjo <john.groups <at> torjo.com> writes:

> But isn't the only point of local functions, the fact that you can
> access context information (like, the arguments passed to your function)?

Did you mean 'passed to your *outer* function'?

To pass bound arguments you either

1. struct local { int& i; void body(char c) { i = c; } };
2. struct local { static void body(int&, char c) { i = c; }

The body of the former isn't static and can't be passed to a template.
The former doen't have an opening bracket before your first unbound argument:

int i;
void BOOST_LOCAL_FUNCTION(i) char c)
{
} ...

Note missing '(' in the first line.

--
Alexander

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