Joel Falcou wrote:
Eric Niebler a écrit :
Certainly, but not with any of Proto's "built-in" transforms. Generic tree traversal is a HUGE domain, and not something I can just whip out. ;-) Dan Marsden has been working on that problem for some time with his Boost.Traversal library. The Haskell folks have done lots of work in this area, too. Just Google "Scrap Your Boilerplate" and see how deep the rabbit hole goes.
Yeah I kinda digged into it last time I bothered you with my code snippet a few month ago. Well, what kind of approach can be take to get something simple going on ?
My advice to you would be the same as my advice to Kim. Much can be done with recursion and proto::fold. Copy the implementation from proto::fold_tree or proto::reverse_fold_tree and modify it as needed. http://boost-sandbox.sourceforge.net/libs/proto/doc/html/boost/proto/fold_tr... HTH, -- Eric Niebler BoostPro Computing http://www.boostpro.com