Previous fileTop of DocumentContentsIndex pageNext file
Apache C++ Standard Library Reference Guide

reverse_copy()

Library:  Algorithms


Function

Local Index

No Entries

Summary

An algorithm that reverses the order of elements in a sequence while copying them to a new sequence

Synopsis

#include <algorithm>

namespace std {
  template <class BidirectionalIterator, class OutputIterator>
  OutputIterator reverse_copy(BidirectionalIterator start,
                              BidirectionalIterator finish,
                              OutputIterator result);
}

Description

The reverse_copy() algorithm copies the range [start, finish) to the range [result, result + (finish - start)) such that for any nonnegative integer i < (finish - start), the following assignment takes place:

*(result + (finish - start) - i) = *(start + i)

reverse_copy() returns result + (finish - start). The ranges [start, finish) and [result, result + (finish - start)) must not overlap.

Complexity

reverse_copy() performs exactly (finish - start) assignments.

Example

See Also

reverse()

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems -- Programming Language C++, Section 25.2.9



Previous fileTop of DocumentContentsIndex pageNext file