unary_function<T, bool>
Member | Where defined | Description |
---|---|---|
argument_type | Adaptable Unary Function | The type of the second argument: |
result_type | Adaptable Unary Function | The type of the result: |
bool operator()(const T& x) const | Unary Function Function call operator. | The return value is |
logical_not() | Default Constructible | The default constructor. |
The function object overview,
Generalized identity operations
identity<T>
Category: functors
Component type: type
int main() {
int x = 137;
identity<int> id;
assert(x == id(x));
}
Defined in the standard header functional, and in the nonstandard backward-compatibility header function.h. This class is an SGI extension; it is not part of the C++ standard.
Parameter | Description |
---|---|
T | The function object's argument type, and return type. [1] |
Adaptable Unary Function
None.
unary_function<T, T>
Member | Where defined | Description |
---|---|---|
argument_type | Adaptable Unary Function | The type of |
result_type | Adaptable Unary Function | The type of the result: |
const T& operator()(const T&) const | Adaptable Unary Function | Function call. The return value is simply the argument. |
All of
Вы читаете Standard Template Library Programmer's Guide