
Hello folks. I'm trying to use the iter_fold and reverse_iter_fold algorithms in MPL, since I want to operate on sub-ranges of an input sequence. Now if I do just the trivial case of dereferencing the current element, then all is well: struct works { typedef typename reverse_iter_fold< T, vector_c<long>, push_front<_1, deref< _2 > > >::type type; }; I can successfully instantiate this with, for example, vector_c<int,1,2,3,4>. But when I do iterator arithmetic (e.g. prior, next or begin) I run into trouble: struct fails { typedef typename reverse_iter_fold< T, vector_c<long>, push_front<_1, deref< next<_2> > > >::type type; }; -- error messages about arg 3 - I suspect that prior is being applied to the placeholder arg type itself, not to the iterator. I'm wondering if I should be using lambda/apply, but I've tried that without success. What's a would-be template metaprogrammer to do? Regards Rob