Minor detail: will use ::toupper() rather than std::toupper() overloads, only a problem if underlying character type of string type changes.