Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
rotate
Prototype

template<class ForwardRange>
ForwardRange& rotate(ForwardRange& rng,
                     typename range_iterator<ForwardRange>::type middle);

template<class ForwardRange>
const ForwardRange& rotate(const ForwardRange& rng,
                           typename range_iterator<const ForwardRange>::type middle);

Description

rotate rotates the elements in a range. It exchanges the two ranges [begin(rng), middle) and [middle, end(rng)). Returns a reference to rng.

Definition

Defined in the header file boost/range/algorithm/rotate.hpp

Requirements
Precondition:
Complexity

Linear. At most distance(rng) swaps are performed.


PrevUpHomeNext