Boost logo

Boost Users :

From: Witz (witz_at_[hidden])
Date: 2004-04-14 17:00:30


just a quick question - which maybe should have been directed at the
developers list but ...

would it be possible in the iterator adaptors to have an operator== defined
that takes the base iterator as the right hand side? it would certainly cut
down on typing and also obviate the need to create an end iterator that is
only used as an 'end of container' sentinel value

if it was possible it would allow us to write, for example:

copy( make_filter_iterator<is_positive_number>(numbers, numbers + N),
      numbers + N, ostream_iterator<int>(cout, " "));

rather than:

copy( make_filter_iterator<is_positive_number>(numbers, numbers + N),
      make_filter_iterator<is_positive_number>(numbers + N, numbers + N),
      ostream_iterator<int>(cout, " "));

of course i am aware that i might be missing something obvious ...

ian whittley


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