Struct template fold_treeboost::proto::fold_tree — A PrimitiveTransform that recursively applies the
Synopsistemplate<typename Sequence, typename State0, typename Fun> struct fold_tree : proto::transform< fold_tree<Sequence, State0, Fun> > { template<typename Expr, typename State, typename Data> struct impl : proto::fold<Sequence, State0, recurse_if_<typename Expr::proto_tag, Fun> > ::template impl<Expr, State, Data> { }; }; Description
template<typename Tag, typename Fun> struct recurse_if_ : proto::if_< // If the current node has type type "Tag" ... boost::is_same<proto::tag_of<proto::_>, Tag>(), // ... recurse, otherwise ... proto::fold<proto::_, proto::_state, recurse_if_<Tag, Fun> >, // ... apply the Fun transform. Fun > {};
With proto::fold< Sequence, State0, recurse_if_<typename Expr::proto_tag, Fun> >()(expr, state, data). It has the effect of folding a tree front-to-back, recursing into child nodes that share a tag type with the parent node. |