Create Sort Objects by Attribute in C++