Nugget
Public Member Functions | Protected Attributes | List of all members
eastl::pointer_to_unary_function< Arg, Result > Class Template Reference

#include <functional.h>

Inheritance diagram for eastl::pointer_to_unary_function< Arg, Result >:
Inheritance graph
[legend]
Collaboration diagram for eastl::pointer_to_unary_function< Arg, Result >:
Collaboration graph
[legend]

Public Member Functions

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

Protected Attributes

Result(* mpFunction )(Arg)
 

Additional Inherited Members

- Public Types inherited from eastl::unary_function< Arg, Result >
typedef Arg argument_type
 
typedef Result result_type
 

Detailed Description

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

pointer_to_unary_function

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);


The documentation for this class was generated from the following file: