As defined by emplace_back, void emplace_back (Args&&... args); is a function of the variation pattern. So, I wrote the following:
#include <vector> int main() { std::vector<int> myvector2(10,0); myvector2.emplace_back(1,2,3,4,5,6); }
The compiler complains:
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.
And OS alerts:
Sorry, Ubuntu 13.04 has experienced an internal error.
The file /tmp/cc7q32tE.out too long to be published here, and this may not help. Am I doing something wrong or a compilation error? I do not understand.
After comments and bug report: jrok gives a very good explanation of why this is happening. I used gcc 4.7, I reported an error, and received the following response:
Jonathan W***** <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Known to work| |4.8.0 --- Comment
source share