Reputation: 22094
Can I perform a ::toupper
transformation on the same string that is the input?
i.e.:
std::transform(s.begin(), s.end(), s.begin(), ::toupper);
or do I need a different target?
Upvotes: 0
Views: 660
Reputation: 248129
Yes. That's legal, and perfectly idiomatic. It's a very common way to do it.
Upvotes: 3