egcs allows deletion of const objects.

Bill Currie bcurrie@tssc.co.nz
Tue Oct 6 14:57:00 GMT 1998


Alexandre Oliva wrote:
> This shouldn't make any difference, from the point of view of
> `delete'.  Constness does not affect the ability to delete.

Hmm, now *I'm* confused.  I distincly remember gcc (2.7.2.1) complaining
about deleting a pointer with a const involved (thinking about it
further, my previous post was bogus, otherwise you can't delete objects
via a reference variable).  Is this a relatively recent change in the
C++ standard?  To me, it just doesn't make sense being allowed to delete
a constant object because const is meant to be a promise that the object
will not be modified, and deleting an object definitly modifies it!

Bill
-- 
Leave others their otherness



More information about the Gcc-bugs mailing list