Original Post
I wanted to convert a string to uppercase, and I figured I'd do it with transform and toupper:
std::transform(string.begin(), string.end(), string.begin(), toupper);
Then I thought I'd try to use the C++ version of toupper. So far, I've gotten to:
std::transform(string.begin(), string.end(), string.begin(),
static_cast<char(std::ctype<char>::*)(char)const>
(std::use_facet<std::ctype<char> >(std::locale()).toupper));
But the compiler says error C2475: 'std::ctype<char>::toupper' : forming a pointer-to-member requires explicit use of the address-of operator ('&') and a qualified name. But when I use &, it says it's an illegal operation on bound member function expression. What's going on?