根据emplace_back的定义,void emplace_back (Args&&... args);
是一个可变参数模板函数。所以,我写了以下内容:
#include <vector>
int main()
{
std::vector<int> myvector2(10,0);
myvector2.emplace_back(1,2,3,4,5,6);
}
编译器抱怨:
g++ -std=c++0x stlstudy.cc
‘
Internal compiler error: Error reporting routines re-entered.
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.7/README.Bugs> for instructions.
Preprocessed source stored into /tmp/cc7q32tE.out file, please attach this to your bugreport.
操作系统警告:
Sorry, Ubuntu 13.04 has experienced an internal error.
/tmp/cc7q32tE.out
文件太长,无法在此处发布,可能无济于事。我做错了什么还是编译错误?我不明白。
在评论和错误报告之后: jrok 很好地解释了为什么会发生这种情况。我使用了 gcc 4.7,我报告了这个错误,我得到了以下响应:
Jonathan W***** <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |4.8.0
--- Comment #1 from Jonathan W***** <redi at gcc dot gnu.org> ---
Seems to be fixed for 4.8 already.