From: Foster T. B. <fbr...@ad...> - 2005-12-13 19:15:29
|
Just a couple comments at this point... On Dec 12, 2005, at 04:57p, Sean Parent wrote: > One option is to nuke the reverse fullorder iterator (Eric?) - you > could still use a general reverse iterator adaptor, but you would > lose the ability to toggle edges which in reverse is a questionable > thing to do (it base iterator does a very odd flip around the > pointed to node). What's the difference between a cursor and an iterator? > Another thing I somewhat dislike is the use of a bool (maybe it > should be called edge and return an enum?) - > > if (i.edge() == adobe::forest_leading_s)... > > I like the idea but dealing with enum types is just plain > cumbersome... adobe/future/enum_ops.hpp may help out with enumeration manipulation. I like the idea of being more explicit about the edge the iterator is on. It makes the code easier to read, and can lend itself to better generalization IMO (see below). > Another option that I'm somewhat fond of is to simply use > leading_of and trailing_of as stand alone functions - then maybe > have an is_leading and is_trailing for completeness- > > <snip> > > is_edge<adobe::forest_leading_s>(i); > i = edge<adobe::forest_trailing_s>(i); This to me would be a natural extension of using the enumerations above -- I like it. Wouldn't it also allow for the consolidation of preorder_iterator and postorder_iterator into some order_iterator<Enum>(), where the while statement is simply while (! this->base().edge() == Enum) ? There could be more consolidation than even this, but it was the first one that I saw. Blessings, Foster -- Foster T. Brereton <}}}>< Romans 3:21-26 A d o b e S o f t w a r e T e c h n o l o g y L a b "The fact is that the author of STL does not know how to write min, the author of C++ is not quite sure, and the standards committee is at a loss." -- Alexander Stepanov |