Man Page pointer_to_binary_function.3



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



NAME

     pointer_to_binary_function

      - A function object that adapts a pointer to a binary func-
     tion, to take the place of a binary_function.





SYNOPSIS

     #include <functional>
     template <class Arg1, class Arg2, class Result>
     class pointer_to_binary_function : public
          binary_function<Arg1, Arg2, Result> ;





DESCRIPTION

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

     The ptr_fun function is overloaded to create instances of  a
     pointer_to_binary_function  when included with the appropri-
     ate pointer to a function.





INTERFACE

     template <class Arg1, class Arg2, class Result>
     class pointer_to_binary_function : public
          binary_function<Arg1, Arg2, Result> {
     public:
       explicit pointer_to_binary_function
                 (Result (*f)(Arg1, Arg2));
       Result operator() (const Arg1&, const Arg2&) const;
     };

     template<class Arg1, class Arg2, class Result>
     pointer_to_binary_function<Arg1, Arg2, Result>
                 ptr_fun (Result (*x)(Arg1, Arg2));





SEE ALSO

     binary_function,                           Function_Objects,
     pointer_to_unary_function, ptr_fun