pointer_to_unary_function is generally used as a type. The function ptr_fun (also defined in header <functional>) can be used to directly construct an object of this type.
This class is derived from unary_function and is typically defined as:
| 1 2 3 4 5 6 7 8 9 10 |
|
Members
- constructor
- Constructs an unary function object class from pointer to a function that takes one argument of type Arg and returns a value of type Result.
- operator()
- Member function taking a single parameter and returning the result of calling the function pointer used at construction.
Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Possible output:
2.30259 2.99573 3.68888 4.38203 5.07517 |
See also
| ptr_fun | Convert function pointer to function object (function template) |
| pointer_to_binary_function | Generate binary function object class from pointer (class template) |
| unary_function | Unary function object base class (class template) |
