General Requirements

| Home | Libraries | People | FAQ | More

#### General Requirements

In the description of generator expressions, the following notation is used:

- `fwdRng` is an expression of a type `R` that models `ForwardRange`
- `biRng` is an expression of a type `R` that models `BidirectionalRange`
- `rndRng` is an expression of a type `R` that models `RandomAccessRange`
- `pred` is an expression of a type that models `UnaryPredicate`
- `bi_pred` is an expression of a type that models `BinaryPredicate`
- `fun` is an expression of a type that models `UnaryFunction`
- `value`, `new_value` and `old_value` are objects convertible to `boost::range_value<R>::type`
- `n,m` are integer expressions convertible to `range_difference<R>::type`

Also note that `boost::range_value<R>::type` must be implicitly convertible to the type arguments to `pred`, `bi_pred` and `fun`.

Range Category in the following adaptor descriptions refers to the minimum range concept required by the range passed to the adaptor. The resultant range is a model of the same range concept as the input range unless specified otherwise.

Returned Range Category is the concept of the returned range. In some cases the returned range is of a lesser category than the range passed to the adaptor. For example, the `filtered` adaptor returns only a `ForwardRange` regardless of the input.

Furthermore, the following rules apply to any expression of the form

    rng | boost::adaptors::adaptor_generator

1. Applying `operator|()` to a range `R` (always left argument) and a range adapter `RA` (always right argument) yields a new range type which may not conform to the same range concept as `R`.

2. The return-type of `operator|()` is otherwise unspecified.

3. `operator|()` is found by Argument Dependent Lookup (ADL) because a range adaptor is implemented in namespace `boost::adaptors`.

4. `operator|()` is used to add new behaviour lazily and never modifies its left argument.

5. All iterators extracted from the left argument are extracted using qualified calls to `boost::begin()` and `boost::end()`.

6. In addition to the `throw`-clauses below, `operator|()` may throw exceptions as a result of copying iterators. If such copying cannot throw an exception, then neither can the whole expression.