template<class BidIt>
void reverse(BidIt first, BidIt last);
The template function evaluates swap
(*(first + N), *(last - 1 - N)
once for each N
in the range [0, (last
- first) / 2)
. Thus, the function reverses the order of elements in the sequence.
See the related sample program.