Result type The type returned when the Unary Function is called
Notation

F A type that is a model of Unary Function

X The argument type of F

Result The result type of F

f Object of type F

x Object of type X

Definitions

The domain of a Unary Function is the set of all permissible values for its argument.

The range of a Unary Function is the set of all possible values that it may return.

Valid expressions
Name Expression Return type
Function call f(x) Result
Expression semantics
Name Expression Precondition Semantics Postcondition
Function call f(x) x is in f's domain Calls f with x as an argument, and returns a value of type Result [1] The return value is in f's range
Models

• Result (*)(X)

Notes

[1] Two different invocations of f may return different results, even if f is called with the same arguments both times. A Unary Function may refer to local state, perform I/O, and so on. The expression f(x) is permitted to change f's state.

See also

Function Object overview, Generator, Binary Function Adaptable Unary Function

Binary Function

Category: functors

Component type: concept

Description

A Binary Function is a kind of function object: an object that is called as if it were an ordinary C++ function. A Binary Function is called with two arguments.

Refinement of

Assignable

Associated types
First argument type The type of the Binary Function's first argument.
Second argument type The type of the Binary Function's second argument.
Result type The type returned when the Binary Function is called
Notation

F A type that is a model of BinaryFunction

X The first argument type of F

Y The second argument type of F

Result The result type of F

f Object of type F

x Object of type X

y Object of type Y

Definitions

The domain of a Binary Function is the set of all ordered pairs (x, y) that are permissible values for its arguments.

The range of a Binary Function is the set of all possible value that it may return.

Valid expressions
Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату