
27 Jan
2011
27 Jan
'11
2:44 p.m.
On 27/01/2011 15:10, Boris Kolpackov wrote:
You probably mean "freeing said buffer" instead of "copying said buffer". The simplest approach would be to stipulate that such a buffer should be allocated with operator new[] and freed with operator delete[].
Oh and calling delete[] (or delete for that matter) on a different type than the one that was used for new[]/new (or a non-base type if the destructor is virtual) is undefined behaviour.