C++是否支持STL或支持Arrays.asList()的外部庫?類似Java的Arrays.asList()在C++中
典型用法
private ArrayList<String> lexeme = new ArrayList<String>(Arrays.asList(" ", ",", "(", ")", ";", "=", ".", "*", "-"));
我使用Visual Studio 11(2012),他們已經不包括C++ 11功能Initializer lists
使我有奎德里作爲初始化九個唯一的字符串向量沒有
std::vector<std::string>::push_back("a");
std::vector<std::string>::push_back("b");
std::vector<std::string>::push_back("c");
. . .
我相信這是接近你的問題和解決問題:HTTP:// stackoverflo w.com/questions/7050485/implementing-a-stdarray-like-container-with-a-c11-initializer-list?rq=1 – quetzalcoatl 2013-04-08 18:11:19