Semantics. The name of the method was resize(). So it should check size(). If you don't care about uninitialized elements, call the method reserve().