I bet if you compile GCC with -std=c++0x, you get the same result as with MSVC, i.e. with the default N constructs. This has changed in C ++ 11, see here . Now there are two overloads: one with a new size, which by default creates new elements, and the other with the "prototype" parameter to copy-assemble each new element.
Now, to get consistent results no matter what mode you compile, just use
v.resize(new_size, T());
: , , , (, std::unique_ptr). . , , .