␡
- 42.1 Introduction
- 42.2 An Invalid Version
- 42.3 Member Iterators Define the Range
- 42.4 So . . . ?
- 42.5 stlsoft::filter_iterator
- 42.6 Constraining the Iterator Category
- 42.7 Summary
- 42.8 On the CD
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"));