Sierra Toolkit
Version of the Day
|
#include <functional_eastl.h>
Inherits eastl::unary_function< Argument, Result >.
Public Member Functions | |
pointer_to_unary_function (Result(*pFunction)(Arg)) | |
Result | operator() (Arg x) const |
Protected Attributes | |
Result(* | mpFunction )(Arg) |
This is an adapter template which converts a pointer to a standalone function to a function object. This allows standalone functions to work in many cases where the system requires a function object.
Example usage: ptrdiff_t Rand(ptrdiff_t n) { return rand() % n; } // Note: The C rand function is poor and slow. pointer_to_unary_function<ptrdiff_t, ptrdiff_t> randInstance(Rand); random_shuffle(pArrayBegin, pArrayEnd, randInstance);
Definition at line 387 of file functional_eastl.h.