Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-02-24 10:54:47

"Joaquín Mª López Muñoz" <joaquin_at_[hidden]> wrote in message

Thorsten Ottosen ha escrito:

> "Justin Gottschlich" <jgottschlich_at_[hidden]> wrote in message

> I'm not sure I like the expression "trees as algorithms". I would like to
> see
> different types of iterators which can then be used to implement algorithms.
> So I only see trees as containers.

|I agree with Thorste here. Thinking about the relation between a tree
|structure and its various iterators, maybe we can adopt a similar conceptual
|approach as Boost.MultiIndex: a tree container is the underyling data
|on top of which several "indices" are provided with different iteration
|typedef tree<element> tree_t;
|tree_t tr;
|tree_t::iterator<inorder>::type it1=tr.get<inorder>().begin; // inorder
|tree_t::iterator<preorder>::type it2=tr.get<preorder>().begin; // preorder
|// convertibility between different types of iterators

I'm not to keen on the idea that iterators are parameterized with an iteration
It would be more natural just to have

tree_t::inorder_iterator i = tr.inorder_begin();
tree_t::preorder_iterator i2 = tr.preorder_begin();

This shouldn't prohibit conversion between the iterators AFAICT, but it will
remove the
need for a lot of template stuff which is only there to make the stuff harder
to use and to make
error messages harder to read.



Boost list run by bdawes at, gregod at, cpdaniel at, john at