24.7 Standard Function Objects, Predicates, and
Binders (cont.)
- 2 binders in C++
- bind1st takes a binary function and a value, binds
that value to the first argument of the input function, producing
a unary function
- bind2nd binds the 2nd argument
- E.g., to search for the first negative number:
list<int>::iterator first_negative =
find_if( a.begin(), a.end(),
bind2nd(less<int>(), 0) );
prev
|top
|next