The function object returned by bind1st 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 first argument.
It is defined with the same behavior as:
| 1 2 3 4 5 |
|
To bind the second parameter to a specific value, see bind2nd.
Parameters
- op
- Binary function object derived from binary_function.
- x
- Fixed value for the first parameter of op.
Return value
An unary function object equivalent to op but with the first parameter always set to x.binder1st is a type derived from unary_function.
Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
There are 2 elements that are equal to 10. |
See also
| bind2nd | Return function object with second parameter binded (function template) |
| binder1st | Generate function object class with 1st parameter binded (class template) |
| unary_function | Unary function object base class (class template) |
| binary_function | Binary function object base class (class template) |
