Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

pointer_to_unary_function


Function Object

Summary

A function object class that adapts a pointer to a function, to take the place of a unary_function.

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

None

Synopsis

#include <functional>
template <class Arg, class Result>
class pointer_to_unary_function : public unary_function<Arg, Result>;

Description

The pointer_to_unary_function class encapsulates a pointer to a single-argument function. The class uses operator() so that the resulting object serves as a function object for that function.

The ptr_fun function is overloaded to create instances of pointer_to_unary_function when included with the appropriate pointer to a function.

Interface

template <class Arg, class Result>
class pointer_to_unary_function : public 
      unary_function<Arg, Result> {

 public:
   explicit pointer_to_unary_function (Result (*f)(Arg));
   Result operator() (const Arg&) const;
};

template<class Arg, class Result>
pointer_to_unary_function<Arg, Result>
  ptr_fun (Result (*f)(Arg));

See Also

Function Objects, pointer_to_binary_function, ptr_fun, unary_function



Previous fileTop of documentContentsIndexNext file
©Copyright 1998, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.
OEM Release, June 1998