This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Placement new[] weirdness
- To: Branko Cibej <branko dot cibej at hermes dot si>
- Subject: Re: Placement new[] weirdness
- From: Andrey Slepuhin <pooh at msu dot ru>
- Date: Fri, 16 Jul 1999 10:57:21 +0400 (MEDT)
- Cc: egcs at egcs dot cygnus dot com
- Organization: Moscow State University Network (MSUnet)
On 16-Jul-99 Branko Cibej wrote:
> Andrey Slepuhin wrote:
>
>> 2) However we still can call placement delete[] by
>> typing operator delete (p,p). ...
>
> I think you're confusing destruction and deallocation.
> They're not interchangeable.
Yes I know. But indeed, there is something weird with new[] and delete[]:
when you are using operator+, you can write
both a+b and operator+(a,b). They are identical.
new[] and delete[] are differ. Why? If the compiler
catch expressions like "delete[] p;", calls object destructors,
and then calls *deallocation* function, why it cannot catch
expressions like "operator delete[](p);" and do the same thing?
Or may be I'm not garanteed that a+b and operator+(a,b)
are identical?
Regards,
Andrey.