First, the accepted answer to this question delete vs delete [] quotes the standard, saying that the behavior is undefined. This should satisfy your colleague. There are more discussions here: Delete [] equal to delete? .
If he is not convinced, you can remind him that the global new/delete , as well as the global new[]/delete[] can be overwritten in these pairs, so even if the pair new[]/delete (for basic types) in the implementation of VS2010 does not crash, there is absolutely no guarantee that another implementation will not fail.
For example, we overwrite the global new[]/delete[] in debug mode to hide the "end of array markers" to test usage. Of course, we expect delete[] be called on double arrays created with new[] for this to work.
However, since I am in the old C ++ er time, I know that the source of your colleague is confused. Think of the simplest implementation of new/delete and new[]/delete[] with C malloc/free for backends and direct calls to constructors / destructors. It is easy to see that for a simple implementation, since the original C ++ implementations were, delete and delete[] were equivalent for types without destructors. On this occasion, a certain folklore was created, which may be the source of your colleague's statement, but it does not really linger and actually never did.
source share