title: When do C++ POD types get zero-initialized?
body: <p>Coming from a C background, I've always assumed the POD types (eg ints) were never automatically zero-initialized in C++, but it seems this was plain wrong!</p>
  
  <p>My understanding is that only 'naked' non-static POD values don't get zero-filled, as shown in the code snippet. Have I got it right, and are there any other important cases that I've missed?</p>
  
  <pre><code>static int a;
  
  struct Foo { int a;};
  
  void test()
  {
    int b;     
    Foo f;
    int *c = new(int); 
    std::vector&lt;int&gt; d(1);
  
    // At this point...
    // a is zero
    // f.a is zero
    // *c is zero
    // d[0] is zero
    // ... BUT ... b is undefined     
  }  
  </code></pre>