使用来自 cygwin g++ 的 STL std::transform 的问题
我正在 cygwin 上运行 g++(gcc 版本 3.4.4)。
我无法编译这一小段代码。我包含了适当的标题。
int main(){
std::string temp("asgfsgfafgwwffw");
std::transform(temp.begin(),
temp.end(),
temp.begin(),
std::toupper);
std::cout << "result:" << temp << std::endl;
return 0;
}
我在使用 STL 容器(例如矢量)时没有遇到任何问题。 有没有人对这种情况有任何建议或见解。 谢谢。
I am running g++(gcc version 3.4.4) on cygwin.
I can't get this small snippet of code to compile. I included the appropriate headers.
int main(){
std::string temp("asgfsgfafgwwffw");
std::transform(temp.begin(),
temp.end(),
temp.begin(),
std::toupper);
std::cout << "result:" << temp << std::endl;
return 0;
}
I have not had any issues using STL containers such as vector.
Does anyone have any suggestions or insights into this situation.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
来自上面的链接。
From the link above.
这很好地解释了这一点。
这将归结为以下代码:
This explains it quite well.
Which will boil down to this code: