|
Boost Users : |
From: George A. Heintzelman (georgeh_at_[hidden])
Date: 2002-02-21 17:51:26
> This isn't a boost specific message per se, I guess, but I thought
> someone here may know the answer.
>
> I have a list<> of smart_ptrs. Some of the elements in the list are
> ready for processing under various circumstances.
>
> What I'd like would be a custom iterator that when I say "++i" it checks
> the element to see if it's ready, and if not, advance to the next, and
> so on until it finds a ready element. If it doesn't find one, then i ==
> list.end(). This would simulate having a list that contained only ready
> elements, without having to have multiple lists.
This *is* a boost specific message!
Try the filter_iterator_adaptor in the iterator_adaptors library.
Cheers,
George Heintzelman
georgeh_at_[hidden]
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net