title: C++ STL allocator vs operator new
body: <p>According to C++ Primer 4th edition, page 755, there is a note saying:</p>
  
  <blockquote>
    <p>Modern C++ programs ordinarily ought to use the allocator class
    to allocate memory. It is safer and more ﬂexible.</p>
  </blockquote>
  
  <p>I don't quite understand this statement. 
  So far all the materials I read teach using <code>new</code> to allocate memory in C++.
  An example of how vector class utilize allocator is shown in the book. 
  However, I cannot think of other scenarios.</p>
  
  <p>Can anyone help to clarify this statement? and give me more examples? 
  When should I use allocator and when to use <code>new</code>? Thanks!</p>