[c++] How to use std::sort to sort an array in C++