Article View: comp.std.c++
Article #360Re: explicit call to destructor
From: 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)
Technical Details
Message-ID:
<867@zinn.MV.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!zaphod.mps.ohio-state.edu!samsung!xylogics!transfer!lectroid!jjmhome!zinn!nuucpShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!zaphod.mps.ohio-state.edu!samsung!xylogics!transfer!lectroid!jjmhome!zinn!nuucp From: mjv@objects.mv.com (Michael J. Vilot) Newsgroups: comp.std.c++ Subject: Re: explicit call to destructor Message-ID: <867@zinn.MV.COM> Date: 18 Aug 90 01:30:12 GMT Sender: nuucp@zinn.MV.COM Lines: 36