Standard C++ Library Class Reference

Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
sort
Algorithm
Summary
Templated algorithm for sorting collections of entities.
Contents
Synopsis
Description
Complexity
Example
Warning
See Also
Synopsis
#include <algorithm>
template <class RandomAccessIterator>
void sort (RandomAccessIterator first,
RandomAccessIterator last);
template <class RandomAccessIterator, class Compare>
void sort (RandomAccessIterator first,
RandomAccessIterator last, Compare comp);
Description
The sort algorithm sorts the elements in the range [first, last) using either the less than (<)
operator or the comparison operator comp. If the worst case behavior is important stable_sort or