Lecture overview -- Keyboard shortcut: 'u'  Previous page: Function objects -- Keyboard shortcut: 'p'  Next page: An example of for-each and function objects -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Lecture 5 - Page 36 : 39
Notes about C++
Templates and The Standard Library
Using the sort algorithm

We reproduce an example program that uses the sort algorithm from cplusplus.com

template <class RandomAccessIterator>
  void sort (RandomAccessIterator first, RandomAccessIterator last);

template <class RandomAccessIterator, class Compare>
  void sort (RandomAccessIterator first, RandomAccessIterator last, Compare comp);

Two overloads of the sort function template.

y:/Kurt/Files/Advanced-programming-cpp/cpp/kn/algorithms/sort/prog-1.cppSorting a vector of integers.