RE: [sv-ec] A question about copy constructors

From: Arturo Salz <Arturo.Salz_at_.....>
Date: Fri Jan 19 2007 - 10:44:31 PST
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 10:44:51 2007

This archive was generated by hypermail 2.1.8 : Fri Jan 19 2007 - 10:45:29 PST