std::sort
only works on random access containers. And the only non-random access container in the standard library that it makes sense to sort is std::list
.
std::sort
certainly doesn't work on associative containers as you seem to think. What sense would that make? Associative containers are accessed by the value of their key, not by position.
As noted by Mike, C++11 also has std::forward_list
, which, by no accident, also has it's own sort function.