simple comparator example for c++