$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Michael Marcin (mmarcin_at_[hidden])
Date: 2007-09-21 17:53:02
I have some code which cycles through items in a list as the user 
presses buttons.
I need to be able to move forward and backwards through this list and 
apply a filtering predicate.
For lists that cycle through the available items when operator++ is 
called on the last iterator before end that satisfies the predicate it 
the iterator should point to the first element that satisfies the 
predicate.  When operator-- is called on that iterator it should point 
to the last iterator before end again.
For lists that traverse the available items without cycling when 
operator++ is called on the last iterator before end that satisfies the 
predicate the iterator should point to the same element.  When 
operator-- is called on the first iterator that satisfies the predicate 
the iterator should point to the same element.
The logic isn't very hard but I'd rather not duplicate it. Are there any 
available iterator adaptors that perform these operations at the range 
limits?
Thanks,
Michael Marcin