shu*_*e87 11 c++ foreach for-loop c++11
我在Jeremy Siek的BoostCon演示中看到了这个c ++ 11代码片段:
deque<int> topo_order;
topological_sort(g, front_inserter(topo_order));
for (int v : topo_order){ //line 39
cout << tasks[v] << endl;
}
Run Code Online (Sandbox Code Playgroud)
尝试在gcc中编译时出现以下错误:
main.cpp:39: error: expected initializer before ‘:’ token
Run Code Online (Sandbox Code Playgroud)
那让我想知道,哪些编译器实际上支持这种语法?
| 归档时间: |
|
| 查看次数: |
9098 次 |
| 最近记录: |