Thread View: comp.std.c++
2 messages
2 total messages
Started by Michael J. Vilot
Sat, 18 Aug 1990 01:30
Re: explicit call to destructor
Author: Michael J. Vilot
Date: Sat, 18 Aug 1990 01:30
Date: Sat, 18 Aug 1990 01:30
36 lines
1610 bytes
1610 bytes
Daniel Edelson points out a change to the grammar: > [E&S 90] section 12.4 says that when a destructor is > explicitly called its name must be fully qualified The copy of the book I have does not state this restriction anywhere in section 12.4. The restriction is instead: ``An explicit call of a destructor must use -> or . explicitly. An attempt to rely on implicit use of the this pointer would lead to confusion between the use of the ~ as part of the name of the destructor and using the unary ~ operator'' and uses an example on page 279 to illustrate. In any event, the language is more than just the grammar. The qualified name is still available through the productions: name: qualified-name qualified-name: qualified-class-name :: name name: ~ class-name The usual semantic differentiations apply, and using the fully qualified name suppresses the dynamic binding of virtual functions. What may astound some people is the change on page 280: ``The notation for explicit call of a destructor may be used for any simple type name. For example, int* p; // ... p->int::~int();'' -- Mike Vilot, ObjectWare Inc, Nashua NH mjv@objects.mv.com (UUCP: ...!decvax!zinn!objects!mjv)
Re: explicit call to destructor
Author: Daniel Edelson
Date: Mon, 20 Aug 1990 19:11
Date: Mon, 20 Aug 1990 19:11
30 lines
1951 bytes
1951 bytes
In article <867@zinn.MV.COM> mjv@objects.mv.com (Michael J. Vilot) writes: >Daniel Edelson points out a change to the grammar: >> [E&S 90] section 12.4 says that when a destructor is >> explicitly called its name must be fully qualified > >The copy of the book I have does not state this restriction anywhere in >section 12.4. The restriction is instead: > ``An explicit call of a destructor must use -> or . explicitly. An > attempt to rely on implicit use of the this pointer would lead to > confusion between the use of the ~ as part of the name of the > destructor and using the unary ~ operator'' >and uses an example on page 279 to illustrate. Page 279 of my book is part of section 12.8, copying objects. Perhaps I have a pre-publication version. In my copy the annotations of section 12.4 contain ``the fully qualified form of the destructor's name must be used to avoid confusion between the use of the ~ as part of the name of the destructor and the unary ~ operator as described in 5.3'' However the document X3J16-0032 contradicts this. I've been told from shopiro@research.att.com that p->~X() is legal, my version of the ARM appears to be pre-publication. >Mike Vilot, ObjectWare Inc, Nashua NH >mjv@objects.mv.com (UUCP: ...!decvax!zinn!objects!mjv) Daniel Edelson daniel@cis.ucsc.edu or sun!practic!peren!daniel (Perennial Software, Inc.)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads