
Brian Braatz wrote:
I am using the fusion code in 1.32 with the vc 71. compiler.
My question is, considering the following unit test (for_each_tests.cpp)
[...]
Why does the functor need to have a const operator()?
I have been trying to take a tuple<> and touch each node in the tuple (ala for_each in fusion), which I was *very* happy to find fusion has this as working functionality.
But, the next step for me is to have the functor write to its local member variables. I.e. requiring const here really limits the usefulness of the fusion::for_each.
I look in my compilers header and noticed that stl::for_each does not have a const requirement on the functor.
Is this a mistake? Is there a reason I am not seeing why for_each would have this limitation?
That's an oversight. It will be fixed immediately after 1.33. I am working on Fusion now. Thanks for noticing! Cheers, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net