Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Rogue Wave C++ Standard Library Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

binary_function

Module:  Standard C++ Library   Library:  General utilities


Does not inherit

Local Index

No Entries

Summary

Base class for creating binary function objects

Synopsis

#include <functional>

namespace std {
  template <class Arg1, class Arg2, class Result>
     struct binary_function{
           typedef Arg1 first_argument_type;
           typedef Arg2 second_argument_type;
           typedef Result result_type;
     };
}

Description

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 C++ Library includes 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 two arguments are called binary function objects. Binary function objects are required to include the typedefs first_argument_type, second_argument_type, and result_type. The binary_function class makes the task of creating templatized binary function objects easier by including the necessary typedefs for a binary function object. You can create your own binary function objects by inheriting from binary_function.

See Also

Function Objects, unary_function, and Section 3.2, "Function Objects," in the User's Guide

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems -- Programming Language C++, Section 20.3.1



Previous fileTop of DocumentContentsIndex pageNext file

Copyright (c) 1994-2006 Rogue Wave Software, a Quovadx Division.
Licensed under the Apache License, Version 2.0.
Contact Rogue Wave about documentation or support issues. You can also seek help from other developers through the Apache stdcxx community (see below).

For more information on the Rogue Wave Standard C++ Library under open source, see Section 1.2 of the user's guide.