
21 Aug
2010
21 Aug
'10
12:13 a.m.
On Fri, Aug 20, 2010 at 6:43 PM, Stefan Strasser <strasser@uni-bremen.de>wrote:
Zitat von David Sankel <camior@gmail.com>:
I've implemented, in particular, foldr1:
template< typename Sequence, typename State, typename F
typename result_of::foldr1<Sequence, F>::type foldr1(
Sequence& seq, F const& f);
Semantics:
Equivalent to f(....f(f(e1,e2),e3)...) where e1 ...eN are the elements of seq.
isn't this equivalent to fold(pop_front(seq),front(seq),f) ?
Almost... fold(pop_front(seq),front(seq), flip( f ) ) where flip returns a version of f with swapped arguments. David -- David Sankel Sankel Software www.sankelsoftware.com 585 617 4748 (Office)