clear() resets the index, even though the memory is still allocated the vector is considered to be empty.