Ok, I wanted I nice way to convert a string to lower case, so I thought to myself "Why reinvent the wheel? A quick google search will surely reveal something useful.", so I had a quick look and was truly alarmed to see what most people seem to be doing and suggesting to others. It is basically this:
Code:
void StringToLower(std::string& str)
{
std::transform(str.begin(), str.end(), str.begin(), tolower);
}
This looks bad to me, really bad! To my understanding it is attempting to overwrite the underlying const data buffer of the string in place!