Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Standard C++ Library Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

reverse_copy()

Module:  Standard C++ Library   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

Copyright (c) 1994-2006 Rogue Wave Software, a Quovadx Division.
Licensed under the Apache License, Version 2.0.
Contact Rogue Wave about documentation or support issues. You can also seek help from other developers through the Apache stdcxx community (see below).

For more information on the Rogue Wave Standard C++ Library under open source, see Section 1.2 of the user's guide.