Boost logo

Boost Users :

Subject: Re: [Boost-users] [fusion] mutable action
From: Joel de Guzman (joel_at_[hidden])
Date: 2011-11-28 02:11:17


On 11/28/2011 7:55 AM, Gennadiy Rozental wrote:
> Hi,
>
> How can I apply mutable action to the fusion sequence?
>
> It seems like fusion::for_each does not allow non const operator().

Function objects are passed around by value. It does not make
sense for them to be mutable. Better yet, give it a reference
to some mutable state, like:

   struct f
   {
     f(T& state) : state(state) {}
     T& state;
     void operator()() const {}
   };

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://boost-spirit.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net