I\'m writing a app for both linux & windows, and noticed that the GCC build is producing a lot of useless calls to the copy constructor.
Here\'s an example code
Try this then:
std::vector vec_a;
vec_a.reserve(3);
for (size_t i = 0; i < 3; ++i)
vec_a.push_back(A());
What you're trying to do is force the initialization process to use construct+move for each value instead of construct and then copy/copy/copy. These are just different philosophies; the libraries authors couldn't possibly know which is going to be the best for any given type.