The do_compare function is in the libstdc++ library. It basically checks two strings and returns -1, 1, or 0 accordingly. Here is the C++ code:
template