
Hello, I'm using boost fusion to do some interesting robotics work. This has come up on the list before, but I'd like to point out my scenario where a mutable transform function would be useful. I'm writing a generic interface generator for various datatypes. For a given instance of the type, the interface generator return a widget that can modify the instance. I'd like my implementation for map types to look like this: //... for_each( transform( mapInstance , toWidget() ) , bind( Layout::addWidget, layout, _1 ) ); //... It has a very nice separation of concerns: 1) the "transform toWidget" function, and 2) the "for_each addWidget" which acts much like a fold. However, my toWidget function requires a non-const reference so this doesn't work without a hacky cast to remove the const. Hackery aside, the only way I know how do to this is using a for_each who's function argument explicity does both the conversion to a widget (with toWidget()) and the folding to the layout. Those two concepts seem separate to me. Maybe there's a better way or maybe I'm not understanding the drawbacks of exposing a mutable transpose function. Thanks, David -- David Sankel Sankel Software www.sankelsoftware.com