🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2534

Re: Virtual functions and destructors

#2534
From: John Max Skaller
Date: Fri, 10 Nov 1995 22:55
33 lines
1524 bytes
martelli@cadlab.it (Alex Martelli) wrote:
>
>parker@WPI.EDU (Chris Parker) writes:
>	...
>If that subclass is destroyed through a pointer to an ancestor whose
>dtor isn't virtual, undefined behaviour (violation of a "shall").


No no! Undefined behaviour is NOT a violation.

Conformance applies to COMPILERS. When behaviour
is not defined, the compiler can produce code that
does anything, because there is no requirement
to satisfy.

So it's exactly the opposite of what you said:
where behaviour is undefined is the one place
it is IMPOSSIBLE for a "shall" to be violated,
because there isn't one :-)

-- 
John Max Skaller               voice: 61-2-566-2189
81 Glebe Point Rd              fax:   61-2-660-0850
GLEBE NSW 2037                 email: maxtal@suphys.physics.oz.au
AUSTRALIA                      email: skaller@maxtal.com.au



---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <480ksh$9lb@oznet03.ozemail.com.au>
Path: arc1-ca.pugleaf.net!128.32.155.1!matt
References: <47r71q$cp0@bigboote.WPI.EDU> <martelli.815930692@cadlab>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!128.32.155.1!matt
From: John Max Skaller <maxtal@suphys.physics.su.oz.au>
Newsgroups: comp.std.c++
Subject: Re: Virtual functions and destructors
Date: 10 Nov 1995 22:55:36 GMT
Organization: MAXTAL
Approved: matt@physics2.Berkeley.EDU (Matt Austern)
Message-ID: <480ksh$9lb@oznet03.ozemail.com.au>
References: <47r71q$cp0@bigboote.WPI.EDU> <martelli.815930692@cadlab>
NNTP-Posting-Host: physics2.berkeley.edu