mercredi 2 novembre 2016

Why does std::vector zero initilize its memory?

i recently noticed that std::vector does clear it's memory with zeros after allocating.

I have created similar containers before (although not std compliant) and i never needed to explicitly zero the memory before creating new items.

I can't see a reason to do that and i was just wondering why.

Aucun commentaire:

Enregistrer un commentaire