Item 3. Predicates, Part 2: Matters of State

I l @ ve RuBoard

Difficulty: 7

Following up from the introduction given in Item 2, we now examine "stateful" predicates. What are they? When are they useful? How compatible are they with standard containers and algorithms?

  1. What are predicates, and how are they used in STL? Give an example.

  2. When would a "stateful" predicate be useful? Give examples.

  3. What requirements on algorithms are necessary in order to make stateful predicates work correctly?

I l @ ve RuBoard


More Exceptional C++
More Exceptional C++: 40 New Engineering Puzzles, Programming Problems, and Solutions
ISBN: 020170434X
EAN: 2147483647
Year: 2001
Pages: 118
Authors: Herb Sutter

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net