stlab.adobe.com Adobe Systems Incorporated

AdaptableBinaryFunction

functors.gif
concept.gif
Category: functors Component type: concept

Description

An Adaptable Binary Function is a BinaryFunction with nested typedefs that define its argument types and result type. [1] [2] These nested typedefs make it possible to use function object adaptors.

Refinement of

BinaryFunction

Associated types

First argument type F::first_argument_type The type of F's first argument
Second argument type F::second_argument_type The type of F's second argument
Result type F::result_type The type returned when the Binary Function is called

Notation

F A type that is a model of Binary Function

Definitions

Valid expressions

None, except for those defined by BinaryFunction

Expression semantics

Complexity guarantees

Invariants

Models

Notes

[1] Note the implication of this: a function pointer T (*f)(X,Y) is a BinaryFunction, but not an Adaptable Binary Function: the expressions f::first_argument_type, f::second_argument_type, and f::result_type are nonsensical.

[2] When you define a class that is a model of Adaptable Binary Function, you must provide these typedefs. The easiest way to do this is to derive the class from the base class binary_function. This is an empty class, with no member functions or member variables; the only reason it exists is to make defining Adaptable Binary Functions more convenient. binary_function is very similar to the base classes used by the iterator_tags functions.

See also

BinaryFunction, AdaptableGenerator, AdaptableUnaryFunction

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google