19 Mar
2007
19 Mar
'07
8:54 p.m.
Christian Henning wrote:
Hi there, is it possible to have a stateful functor object when using fusion::for_each() loop.
I would like to to the following:
<snip code> for_each takes the function object by reference to const, so you have to const qualify operator() and make the data members mutable so you can change them anyway. Note that even if there were overloads for non-const references, the code as-ia wouldn't work because the function objects in the call to for_each are rvalues. Regards, Tobias