Boost logo

Boost :

From: Klaus Nowikow (nowikow_at_[hidden])
Date: 2005-02-11 04:08:21


I am currently evaluating (not testing!) Dave Handley's composite_visitor
from the sandbox. It seems to be quite useable so far, I like it.

Some thoughts:

Instead of providing different functions begin_shallow(), begin_deep() etc.
and the corresponding iterator types, I'd provide an iterator template
with a "traversal policy", like that:

  template <class TraversalPolicy>
  iterator<TraversalPolicy> begin();

The iterators should be implemented using Boost.Iterator, of course.

At the moment I could think of these traversal policies:
* shallow: like shallow_iterator
* postorder: like deep_iterator
* preorder: parent node first, then it's children, recursively
* ancestor: start node, then it's parent, the parent's parent etc.

Does that sound reasonable to you?

Best regards,

Klaus


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk