
4 Apr
2009
4 Apr
'09
2:31 a.m.
on Thu Apr 02 2009, Larry Evans <cppljevans-AT-suddenlink.net> wrote:
One reason I'm interested is that I can't figure out how reverse_fold would work on a sequence, S, such that begin<S>::type with just a forward iterator. I would have thought that you'd need a bidirectional iterator in order to traverse backwards; yet:
https://svn.boost.org/trac/boost/browser/trunk/libs/mpl/test/fold.cpp#L46
shows that it works on lists.
More later, but remember there's recursion involved. You apply the forward function "on the way in" and the reverse one "on the way out" of the recursion. -- Dave Abrahams BoostPro Computing http://www.boostpro.com