This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Placement new[] weirdness


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]