🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: New/Constructor & Destructor/Delete Relationship

#35
From: Jim Adcock
Date: Tue, 03 Nov 1992 19:36
14 lines
1083 bytes
In article <pathak-301092142826@maclab2-e.mitre.org> pathak@mitre.org (Heeren Pathak) writes:
|I need to know if the language enforces the following:
|
|Is the constructor called immediately after the new operator?

No.  See in part $r.5.3.3: "The order of evaluation of the call to an
operator new() to get memory and the evaluation of arguments to 
constructors is undefined"  For example if a parm to the ctor was
itself a new'ed object that new could happen after the new in question,
but before the ctor to whom this new'ed object is a parm.

|Is the delete operator called immediately after the destructor?

I can't find a reference to this issue.  Ill defined?
Technical Details
Message-ID: <1992Nov03.193606.13730@microsoft.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!microsoft!hexnut!jimad
References: <pathak-291092115943@maclab1-e.mitre.org> <pathak-301092142826@maclab2-e.mitre.org>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++
Path: arc1-ca.pugleaf.net!sparky!uunet!microsoft!hexnut!jimad
From: jimad@microsoft.com (Jim Adcock)
Subject: Re: New/Constructor & Destructor/Delete Relationship
Message-ID: <1992Nov03.193606.13730@microsoft.com>
Date: 03 Nov 92 19:36:06 GMT
Organization: Microsoft Corporation
References: <pathak-291092115943@maclab1-e.mitre.org> <pathak-301092142826@maclab2-e.mitre.org>
Lines: 15