Convert string to all uppercase letters with std::transform
I'm using the transform algorithm and std::toupper to achieve this, but can this be done in one line, like this?
transform(s.begin(), s.end(), ostream_iterator(cout, "\n"),std::toupper);
I get an error on this. So do I have to make a unary function for this and call it with transform, or can I use some adaptors?