| Home | Libraries | People | FAQ | More

##### reverse

###### Prototype

    template<class BidirectionalRange>
    BidirectionalRange& reverse(BidirectionalRange& rng);

    template<class BidirectionalRange>
    const BidirectionalRange& reverse(const BidirectionalRange& rng);

###### Description

`reverse` reverses a range. Returns a reference to the reversed range.

###### Definition

Defined in the header file `boost/range/algorithm/reverse.hpp`

###### Requirements

- `BidirectionalRange` is a model of the Bidirectional Range Concept.
- `BidirectionalRange` is mutable.

###### Complexity

Linear. `reverse` makes `distance(rng)/2` calls to `iter_swap`.