Topic: Explicit Destructor Call Syntax


Author: dattatri@metaphor.Metaphor.COM (Dattatri)
Date: 15 Mar 91 00:47:48 GMT
Raw View
Here is something weird with my compiler when I use an explicit call
to a destructor.
As per Pg 279 of the ARM, the syntax "this->~X()" or object.~X()" are
both valid calls to the destructor,  and to explicitly use a direct call
(bypassing the virtual function mechanism) "object.X::~X()".

However the compiler that I'm using rejects this->~X() and object.~X() and
accepts this->X::~X() and object.X::~X().

I've used same code shown in the ARM.

Did anything change in the standard after the ARM was published?

Thanks in advance

Kayshav -- dattatri@metaphor.com




Author: mwb@ulysses.att.com (Michael W. Balk)
Date: 16 Mar 91 23:48:02 GMT
Raw View
In article <2117@metaphor.Metaphor.COM>, dattatri@metaphor.Metaphor.COM (Dattatri) writes:
> Here is something weird with my compiler when I use an explicit call
> to a destructor.
> As per Pg 279 of the ARM, the syntax "this->~X()" or object.~X()" are
> both valid calls to the destructor,  and to explicitly use a direct call
> (bypassing the virtual function mechanism) "object.X::~X()".
>
> However the compiler that I'm using rejects this->~X() and object.~X() and
> accepts this->X::~X() and object.X::~X().
>
> I've used same code shown in the ARM.


I have encountered the same problem using cfront R2.1.  Recently (December)
Bjarne posted an errata list for the ARM to this newsgroup, but it makes
no mention of any corrections to page 279.
Maybe in R3?


Michael W. Balk
AT&T Bell Laboratories
Murray Hill, NJ 07974
mwb@ulysses.att.com