Next : , Previous : Unique, Top : Table of  Contents


Reverse

reverse (BidirectionalIterator first, BidirectionalIterator last) Function

template 
void reverse(BidirectionalIterator first, BidirectionalIterator last);

For each non-negative integer i <= (last - first)/2, reverse applies swap to all pairs of iterators first + i, (last - i) - 1. Exactly (last - first)/2 swaps are performed.

OutputIterator reverse_copy (BidirectionalIterator first, BidirectionalIterator last, OutputIterator result) Function

template 



OutputIterator reverse_copy(BidirectionalIterator first,
                            BidirectionalIterator last, OutputIterator result);

reverse_copy copies the range [first, last) to the range [result, result + (last - first)) such that for any non-negative integer i < (last - first) the following assignment takes place: *(result + (last - first) - i) = *(first + i). reverse_copy returns result + (last - first). Exactly last - first assignments are done. The result of reverse_copy is undefined if [first, last) and [result, result + (last - first)) overlap.