I believe that the C++ standard for std::sort does not guarantee O(n) performance on a list that\'s already sorted. But still, I\'m wondering whether to your knowledge any i
There's no guarantee that it'll check this. Some implementations will do it , others probably won't.
However, if you suspect that your input might already be sorted (or nearly sorted), std::stable_sort might be a better option.
std::stable_sort