1) Theoretical knowledge of function adapters
2) Frequent use of function function adapters
The standard library provides a set of function adapters that specialize or extend a unary and two-tuple function object. Frequently used adapters are:
1. Binder (Binder): Binders bind a two-tuple function object to a particular value. Convert it to a unary function object.
The C + + standard library provides two pre-defined binder adapters: bind1st and bind2nd. The former binds the value to the first argument of a two-tuple function object, and the latter is bound to the second actual participation.
2. Inversion (negator): Negator is a function adapter that flips the value of a function object. The standard library provides two pre-defined Ngeator adapters: NOT1 flips a dollar in advance to define the true value of the function object, while Not2 flips the truth value of the two-tuple predicate function.
Use the list of function adapters frequently such as the following:
bind1st (OP, value)
bind2nd (OP, value)
Not1 (OP)
Not2 (OP)
Mem_fun_ref (OP)
Mem_fun (OP)
Ptr_fun (OP)
STL algorithm design concept-Function adapter