Name

pointer_to_binary_function class template — Functional for a pointer to a binary function

Synopsis

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

The pointer_to_binary_function class template is a function object that wraps a pointer to a function, in which the function is an ordinary (nonmember) function that takes two arguments. The ptr_fun function template is the most convenient way to create a pointer_to_binary_function object.

Get C++ In a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.