The function object returned by bind2nd has its operator() defined such that it takes only one argument. This argument is used to call binary function object op with x as the fixed value for the second argument.
It is defined with the same behavior as:
| 1 2 3 4 5 |
|
To bind the first parameter to a specific value, see bind1st.
Parameters
- op
- Binary function object derived from binary_function.
- x
- Fixed value for the second parameter of op.
Return value
An unary function object equivalent to op but with the second parameter always set to x.binder2nd is a type derived from unary_function.
Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
There are 3 negative elements. |
See also
| bind1st | Return function object with first parameter binded (function template) |
| binder2nd | Generate function object class with 2nd parameter binded (class template) |
| unary_function | Unary function object base class (class template) |
| binary_function | Binary function object base class (class template) |
