title: Is delete and delete[] equivalent for basic data types
body: <p>So during a code review, a colleague of mine used a <code>double* d = new double[foo];</code> and then called <code>delete d</code>. I told them that they should change it to <code>delete [] d</code>. And they stated that the compiler doesn't need that for basic data types. I disagreed.</p>
  
  <p>So I thought I'd prove my point with an experiment: </p>
  
  <pre><code>#define NUM_VALUES 10000
  int main(int argc,char** argv)
  {
    int i = 0;
    while (true)
    {
      std::cout &lt;&lt; i &lt;&lt; "|";
      double* d = new double[NUM_VALUES];
      std::cout &lt;&lt; ((void*)d) &lt;&lt; std::endl;
      for (int j = 0; j &lt; NUM_VALUES; j++)
        d[j] = j;
  
      delete d;
      i++;
    }
  
    return 0;
  }
  </code></pre>
  
  <p>Not only does the memory usage not grow, but d is allocated to the same place every time! (Visual Studio 2010). Is this a quirk of the visual studio compiler? Or is this part of the standard?</p>