
5 May
2007
5 May
'07
8:13 p.m.
Jeff Garland wrote:
By the standard I believe it is technically undefined behavior. But as a practical matter it's defined exactly the same on all compilers -- call the base class destructor.
The relevant quote is in 5.3.5/3: "In the first alternative (delete object ), if the static type of the operand is different from its dynamic type, the static type shall be a base class of the operand’s dynamic type and the static type shall have a virtual destructor or the behavior is undefined." I really don't think that a Boost library should intentionally contain undefined behaviour, even if the actual behaviour is very consistent between implementations. Sebastian Redl