Sierra Toolkit Version of the Day
eastl::pointer_to_unary_function< Arg, Result > Class Template Reference

#include <functional_eastl.h>

Inherits eastl::unary_function< Argument, Result >.

List of all members.

Public Member Functions

 pointer_to_unary_function (Result(*pFunction)(Arg))
Result operator() (Arg x) const

Protected Attributes

Result(* mpFunction )(Arg)

Detailed Description

template<typename Arg, typename Result>
class eastl::pointer_to_unary_function< Arg, Result >


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.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines