Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

reverse
PrevUpHomeNext
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.


PrevUpHomeNext