c++98

Constructing a vector in C++11 breaks the old code

When porting code from C++98 to C++11, I ran into a problem: #include <iostream> #include <vector> struct A { ... std::vector<A>(5); } This code should output 122222, and outputs 11111. Why is this happening, and how to fix it?