Intro to the Standard Algorithm library
- Again, there are too many items to discuss all of them here.
- Two or three are really useful
-
#include < algorithm>
- find family
-
constexpr InputIt find( InputIt first, InputIt last, const T& value );
- It takes a iterator on where to start searching,
- An iterator one past the last place to search
- And a key
- It returns an iterator pointing to the first occurrence or one past the last item.
- There are many other iterations of find. Look them over.
- sort
-
constexpr void sort( RandomIt first, RandomIt last );
-
constexpr void sort( RandomIt first, RandomIt last, Compare comp );
- iterator to first, iterator to second
- Optional comparison function.