In this post one of the answers recommends changing a std::string
case this way:
std::string str = "Hello World";
std::transform(str.begin(), str.end(),str.begin(), ::toupper);
I've used it and it works so far in Visual Studio 2010. But is it guaranteed by the standard to always work? My concern is that I can imagine the possibility of implementations where writing to the output iterator (the third argument) could invalidate the input iterators (arguments one and two).
So, in summary, is the above method safe and portable?