Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
reverse_fold
Description

Returns the result type of reverse_fold.

Synopsis
template<
    typename Sequence,
    typename State,
    typename F>
struct reverse_fold
{
    typedef unspecified type;
};

Table 1.44. Parameters

Parameter

Requirement

Description

Sequence

A model of Bidirectional Sequence

The sequence to iterate

State

Any type

The initial state for the first application of F

F

boost::result_of<F(S,E)>::type is the return type of f(s,e) with current state s of type S, and an element e of type E in seq

The operation to be applied on traversal


Expression Semantics
reverse_fold<Sequence, State, F>::type

Return type: Any type

Semantics: Returns the result of applying reverse_fold to a sequence of type Sequence, with an initial state of type State and binary function object or function pointer of type F.

Complexity

Linear, exactly result_of::size<Sequence>::value applications of F.

Header
#include <boost/fusion/algorithm/iteration/reverse_fold.hpp>
#include <boost/fusion/include/reverse_fold.hpp>

PrevUpHomeNext