| Home | Libraries | People | FAQ | More

##### UnaryGenerator

###### Description

UnaryGenerator is a composite generator that has a single subject. The UnaryGenerator may change the behavior of its subject following the Delegate Design Pattern.

###### Refinement of

> `Generator`

Notation

`g`

  A UnaryGenerator.

`G`

  A UnaryGenerator type.

###### Valid Expressions

In addition to the requirements defined in `Generator`, for any UnaryGenerator the following must be met:

Expression | Semantics | Return type
--- | --- | ---
`g.subject` | Subject generator. | `Generator`

###### Type Expressions

Expression | Description
--- | ---
`G::subject_type` | The subject generator type.
`traits::is_unary_generator<G>::type` | Metafunction that evaluates to `mpl::true_` if a certain type, `G` is a UnaryGenerator, `mpl::false_` otherwise (See MPL Boolean Constant).

###### Invariants

For any UnaryGenerator, `G`, the following invariant always holds:

- `traits::is_generator<G::subject_type>::type` evaluates to `mpl::true_`

###### Models

The following generators conform to this model:

- Kleene Star (unary `*`) operator,
- Plus (unary `+`) operator,
- Optional (unary `-`) operator,
- And predicate (unary `&`) and Not predicate (unary `!`) operators,
- `left_align`, `center`, and `right_align` directives,
- `repeat` directive,
- `verbatim` directive,
- `delimit` directive,
- `lower` and `upper` directives,
- `maxwidth` directive,
- `buffer` directive,
- `omit` directive.

FIXME Add more links to models of UnaryGenerator concept