Книга: Standard Template Library Programmer
Binary Predicate
Разделы на этой странице:
Binary Predicate
Category: functors
Component type: concept
Description
A Binary Predicate is a Binary Function whose result represents the truth or falsehood of some condition. A Binary Predicate might, for example, be a function that takes two arguments and tests whether they are equal.
Refinement of
Binary Function
Associated types
Result type | The type returned when the Binary Predicate is called. The result type must be convertible to bool. |
Notation
F
A type that is a model of Binary Predicate
X
The first argument type of F
Y
The second argument type of F
f
Object of type F
x
Object of type X
y
Object of type Y
Valid expressions
Name | Expression | Return type |
---|---|---|
Function call | f(x,y) |
Convertible to bool |
Expression semantics
Name | Expression | Precondition | Semantics | Postcondition |
---|---|---|---|---|
Function call | f(x,y) |
The ordered pair (x,y) is in the domain of f. | Returns true if the condition is satisfied, false if it is not. | The result is either true or false. |
Models
• bool (*)(int,int)
• equal_to
See also
Predicate, Adaptable Predicate, Adaptable Binary Predicate
Оглавление статьи/книги
Похожие страницы
- 13.6. Miscellaneous Binary Utilities
- binary_negate
- Adaptable Binary Predicate
- Binary Serialization
- 2. Binary – the way micros count
- 13.5. Binary Utilities
- 1.6 Converting Binary Numbers into Decimal
- 1.7 Converting Decimal Numbers into Binary
- 1.8 Converting Binary Numbers into Hexadecimal
- 1.9 Converting Hexadecimal Numbers into Binary
- 1.14 Converting Octal Numbers into Binary
- 1.15 Converting Binary Numbers into Octal