That's right. It was just another solution. I thought that perhaps the OP would like to see how transform() works.That's just a hand-coded transform()... Why do that when you already have it? And yeah, std::tolower is probably the right way.
Yes, I figured that out eventually . . . sorry, I edited it out because I thought no one would have had time to read it. Evidently someone did.I caught you in mid-edit when you said you suspected back_inserter to be the problem... back_inserter DOES return an output iterator -- this is the whole purpose of it.