title: memset on vector<int>
body: <p>As per <a href="https://stackoverflow.com/a/1665038/409263">Mark Ransoms answer</a> on using memset, i am using memset on a <code>vector&lt;int&gt;</code> to assign values to all the elements.     </p>
  
  <pre><code>memset(&amp;match_begin[0], 0xff , sizeof(match_begin[0]) * match_begin.size());
  </code></pre>
  
  <p>It does have a significant performance improvement over <code>std::fill</code> and it works fine(g++ 4.3.2, 64bit linux). Is this code safe , as in , would std::vector implementations always guarantee that memory allocation for the data will be contiguous? Is it possible that in a future(or different) implementation of the stl library that this might change and break my code later?</p>