title: How to reset a C++ vector of built-ins with zeros?
body: <p>If efficency is an issue and I need vectors, what should I use? </p>
  
  <pre><code>assert(myVector.size() == wantedSize)
  memset(&amp;*myVector.begin(),0,myVector.size() * sizeof(T)); 
  
  myVector.clear(); 
  myVector.resize(wantedSize); 
  
  myVector.clear(); 
  myVector.assign(wantedSize,0);
  </code></pre>
  
  <p>I can assume that wantedSize = size() </p>