FYI, I submitted a new mantis item 1719 for these copy ctor issues. Bill -----Original Message----- From: Arturo Salz [mailto:Arturo.Salz@synopsys.com] Sent: Friday, January 19, 2007 1:45 PM To: Rich, Dave; Steven Sharp; William Paulsen; sv-ec@eda-stds.org; Arturo.Salz@synopsys.com Subject: RE: [sv-ec] A question about copy constructors I'm sorry but Steve is correct. The new method is called the constructor precisely because it creates (i.e., allocates) the object. When someone writes code such as: p = new q; After executing that statement, the expectation is that p will contain a handle to an object that has been created. The term new implies that a *newly created* object has been initialized. If the source handle is null, you cannot create an object copy so the only reasonable thing is to issue an error. As I said before, relaxing the implementation only leads to additional debug by users. If having a null object is OK then that check should be done by the user prior to calling the copy constructor. Arturo -----Original Message----- From: Rich, Dave [mailto:Dave_Rich@mentor.com] Sent: Thursday, January 18, 2007 5:23 PM To: Steven Sharp; paulsen@cadence.com; sv-ec@eda-stds.org; Arturo.Salz@synopsys.COM Subject: RE: [sv-ec] A question about copy constructors A copy of nothing is nothing... 'nothing' IS created. Nothing from Nothing leaves Nothing.... http://billypreston.lyrics.info/nothingfromnothing.html > -----Original Message----- > From: Steven Sharp [mailto:sharp@cadence.com] > Sent: Thursday, January 18, 2007 4:21 PM > To: sharp@cadence.com; paulsen@cadence.com; sv-ec@eda-stds.org; > Arturo.Salz@synopsys.com; Rich, Dave > Subject: RE: [sv-ec] A question about copy constructors > > > >But you are making a copy of what the handle points to: nothing. > > But 'new' creates an object. If you do not create an object, then you > have not performed the primary function of 'new'. If you do create an > object, then that object is not a copy of what the other handle points > to. > > Steven Sharp > sharp@cadence.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Fri Jan 19 11:39:26 2007
This archive was generated by hypermail 2.1.8 : Fri Jan 19 2007 - 11:39:31 PST