Just personal preference but I find the usage of ! with std::string::compare() very confusing and prefer the more obvious == 0. Obviously the result is the same just IMO better readability.