Update Using Comparator in C++