【发布时间】:2018-08-28 03:01:21
【问题描述】:
不小心写了
std::set<string> keys;
作为:
std:set<string> keys;
但奇怪的是,Visual Studio 2013 仍然可以编译。
为什么会这样?
其实keys不仅是定义的,而是后来作为一组字符串使用的,比如
if(keys.find(keystr)==keys.end()){
keys.insert(keystr);
toret.push_back(tempv);
}
【问题讨论】:
-
std:被解释为label的goto。见:en.cppreference.com/w/cpp/language/goto
标签: c++ visual-studio