我在这里找到了一个类似的问题why am I getting "non-aggregate cannot be initialized with initializer list",但答案说它现在有效,但对我来说似乎并不适用。代码:
vector<int> temp = {1,2,3,4,5};
我收到的错误:
test.cpp:18:14: error: non-aggregate type 'vector<int>' cannot be initialized
with an initializer list
vector<int> temp = {1,2,3,4,5};
当我尝试:
clang++ --version
我明白了:
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.2.0
Thread model: posix
最后一个线程是否正确,它应该现在可以正常工作还是我在编译时犯了错误? 感谢。