Книга: Standard Template Library Programmer
Adaptable Generator
Разделы на этой странице:
Adaptable Generator
Category: functors
Component type: concept
Description
An Adaptable Generator is a Generator with a nested typedef that defines its result type. [1] This nested typedef makes it possible to use function object adaptors.
Refinement of
Generator
Associated types
Result type | F::result_type |
The type returned when the Generator is called |
Notation
F
A type that is a model of Adaptable Generator
Valid expressions
None, except for those defined by Generator
Models
The STL does not include any types that are models of Adaptable Generator. An example of a user-defined Adaptable Generator is as follows.
struct counter {
typedef int result_type;
counter() : n(0) {}
result_type operator()() { return n++; }
result_type n;
};
Notes
[1] Note the implication of this: a function pointer T (*f)() is a Generator, but not an Adaptable Generator: the expression f::result_type is nonsensical.
See also
Generator, Adaptable Unary Function, Adaptable Binary Function
- Adaptable Unary Function
- Generator
- Adaptable Binary Function
- Adaptable Predicate
- Adaptable Binary Predicate
- Random Number Generator
- Easy Firewall Generator
- Using a Pseudorandom Number Generator
- PROJECT 10.2 — Random Number Generator
- Роль System.Reflection.Emit.ILGenerator
- Advanced Data Generator для Firebird