Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-02-26 17:46:18


This looks like a good application for the iterator adaptor library, which
is available in the CVS archive and the next complete boost release.

-Dave

----- Original Message -----
From: "Craig Henderson" <craigh_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Monday, February 26, 2001 4:36 AM
Subject: [boost] does boost have iterators for nested std::list, or similar
?

> I am looking for a solution to the problem of iterating through a list of
a
> list using STL iterator technique, and wonder if boost provides any such
> functionality.
>
> for example, I have definitions such as
> class Element;
> typedef ElementList_t std::list<Element const *>;
> typedef GroupList_t std::list<ElementList const *>;
>
> and given a GroupList I need to iterator all the elements in a manner
along
> the lines of
>
> GroupList_t group;
> ElementList_t::const_iterator iter;
> for (iter = group.first_element(); iter!=group.last_element(); iter++)
> {
> Element const *pElement = *iter;
> ...
> }
>
> Now, obviously the iterator is going to have to be intelligent enough to
> iterate each ElementList in turn and move onto the next when appropriate.
>
> Before I begin development of such an iterator I thought it worth asking
the
> question of my peers ;)
>
> TIA
> Craig Henderson (new to boost)
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


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