Container‐based version of the <algorithm> std::rotate_copy() function to shift a container's elements leftward such that the middle element becomes the first element in a new iterator range.

Synopsis

Declared in <absl/algorithm/container.h>

template<
    typename C,
    typename OutputIterator>
constexpr
OutputIterator
c_rotate_copy(
    C const& sequence,
    /* implementation-defined */ middle,
    OutputIterator result);

Return Value

An iterator to the end of the written range in the output.

Parameters

Name

Description

sequence

The container whose elements to rotate.

middle

An iterator to the element that becomes the new first element.

result

The output iterator receiving the rotated elements.

Created with MrDocs