HP C++ User Documentation


unary_function (3C++std) - Tru64 UNIX

Standard C++ Library
Copyright 1996, Rogue Wave Software, Inc.


  unary_function  - Base class for creating unary function objects.


  #include <functional>

  template <class Arg, class Result>
  struct unary_function{
   typedef Arg argument_type;
   typedef Result result_type;


  Function objects are objects with an operator() defined.  They are
  important for the effective use of the standard library's generic
  algorithms, because the interface for each algorithmic template can accept
  either an object with an operator() defined or a pointer to a function.
  The standard library provides both a standard set of function objects, and
  a pair of classes that you can use as the base for creating your own
  function objects.

  Function objects that take one argument are called unary function objects.
  Unary function objects are required to provide the typedefs argument_type
  and result_type.  The unary_function class makes the task of creating
  templated unary function objects easier by providing the necessary typedefs
  for a unary function object.  You can create your own unary function
  objects by inheriting from unary_function.


  function objects, and Function Objects Section in User's Guide.


  ANSI X3J16/ISO WG21 Joint C++ Committee
About PDF files: The PDF files on this site can be read online or printed using Adobe® Acrobat® Reader. If you do not have this software on your system, you may download it from Adobe's website.
Privacy statement Using this site means you accept its terms C++ support
© 2008 Hewlett-Packard Development Company, L.P.