Home > Articles > Programming > C/C++

  • Print
  • + Share This
This chapter is from the book

42.3 Member Iterators Define the Range

It is clear that a filtering iterator instance must have access to a pair of iterators in order to avoid going outside the valid range. That being the case, our client code will be more verbose, for example:

search_sequence  files(".", "*", recls::FILES | recls::RECURSIVE);

std::copy(filter(files.begin(), files.end(), is_readonly())
    , filter(files.end(), files.end(), is_readonly())
    , std::ostream_iterator<search_sequence::value_type>(std::cout
                                                       , "\n"));
  • + Share This
  • 🔖 Save To Your Account