title: unique pointer memory leak
body: <p>I was wondering if anyone could help me to sort out a bit of confusion I have with unique pointers. Consider the following code:</p>
  
  <pre><code>// some class "complex" defined here
  
  int main()
  {
      while(1) 
      {
          unique_ptr&lt;complex&gt; p(new complex[256]);
          p.reset();
      }
      return 1;
  }
  </code></pre>
  
  <p>Now from what I understand, when I invoke <code>reset()</code> on the unique pointer it should delete the object that its raw pointer is referring to. In this case, the object happens to be the very first object of type <code>complex</code> out of 256 created. Because that's what <code>new complex[256]</code> does, am I right? It simply returns a pointer to the first object in the array (which it, of course, also creates)? So the rest of 256 objects should remain untouched.</p>
  
  <p>Following that logic, the infinite loop should create a memory leak, but that does not happen. I am using MS Visual Studio 2013. </p>
  
  <p>What am I missing? I would be very grateful if anyone could fill me in on what's happening here and confirm or disapprove my conjectures</p>