Our team just ran into the same issue described here http://forums.codeguru.com/archive/index.php/t-514404.html, i.e. calling some_vec.resize(new_size)
, where N = new_size - some_vec.size()
with N >= 2, and VC10 default-constructed all N new elements, whereas GCC default constructed a single element, as the prototype element, to copy-construct it N times for the new elements.
Since this is a vector of uuid, where the default-constructor randomly initializes each new instance, we ended up with N times the same uuid with GCC and N different uuids with VC. That was enough to wreak havoc in our test suite on one platform but not another, and was no fun to find.
My question is thus: who is right? VC or GCC? Or is this one of those beloved corners of C++ that's unspecified? TIA, --DD