Boost logo

Boost Users :

Subject: [Boost-users] [Boost.Range] Filter adaptor
From: Justin Leonard (justinleona_at_[hidden])
Date: 2010-07-22 18:12:31


I think I'm missing something obvious - but here goes.
I'm trying to rewrite the a loop similar to the following using
boost::range:

[code]
boost::range_iterator<Doubles>::type i = boost::begin(first_range);
boost::range_iterator<Doubles>::type j = boost::begin(second_range);

for( ; i != boost::end(first_range) && j != boost::end(second_range);
++i,++j) {
   if( f(*i) )
      g(*j);
}
[/code]

Is there something similar to:
[code]
for_each( filtered( second_range,first_range,f ) , g );
[/code]
to use in place of the above?

Thanks,
Justin Leonard



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