Eric Niebler schrieb:
Ok, i have understood that child nodes must share a tag type with the
parent node as indicated by the document
template
struct recurse_if_ :
proto::if_ http://boost-sandbox.sourceforge.net/libs/proto/doc/html/boost/proto/if_.htm...<
// If the current node has type type "Tag" ...
boost::is_samehttp://boost-sandbox.sourceforge.net/libs/proto/doc/html/boost/proto/tag_of....http://boost-sandbox.sourceforge.net/libs/proto/doc/html/boost/proto/_.html>, Tag>(),
// ... recurse, otherwise ...
proto::fold http://boost-sandbox.sourceforge.net/libs/proto/doc/html/boost/proto/fold.ht...http://boost-sandbox.sourceforge.net/libs/proto/doc/html/boost/proto/_.html, proto::_state http://boost-sandbox.sourceforge.net/libs/proto/doc/html/boost/proto/_state...., recurse_if_ >,
// ... apply the Fun transform.
Fun
{};
So my next step will be to define my own fold function.
Thanks a lot to all the people here.
Cheers
Kim Tang
My advice to you would be the same as my advice to Kim. Much can be
done with recursion and proto::fold. Copy the implementation from
proto::fold_tree or proto::reverse_fold_tree and modify it as needed.
http://boost-sandbox.sourceforge.net/libs/proto/doc/html/boost/proto/fold_tr...
HTH,