为什么是这样?
transform(theWord.begin(), theWord.end(), theWord.begin(), std::tolower);
- 不工作
transform(theWord.begin(), theWord.end(), theWord.begin(), tolower);
- 不工作
但
transform(theWord.begin(), theWord.end(), theWord.begin(), ::tolower);
- 确实有效
theWord 是一个字符串。我是using namespace std;
为什么它与前缀一起使用::
而不是与std::
或不一起使用?
谢谢你的帮助。