External sort in C++