Jerry Coffin wrote:
> As others have pointed out, the value is guaranteed to be zero.
Sometimes I feel this is counter-productive speedwise.
If I want to allocate a large array of, for example, integers and I
don't need for them to be initialized to anything (eg. because right
after the allocation I initialize them manually to some values), the
std::vector will uselessly go through the allocated array, initializing
every value with 0, right after which I go again through the vector and
initialize the values to something else. This is wasted time.
If I allocate the array with 'new', it won't do anything to it and it
will be much faster.