Re: Any compiler warning for default copy constructors?
Re: Any compiler warning for default copy constructors?
- Subject: Re: Any compiler warning for default copy constructors?
- From: Steve Baxter <email@hidden>
- Date: Thu, 23 Feb 2006 02:30:40 +0000
Also worth getting into the habit of declaring a private copy
constructor and operator = for classes that are not designed to be
copied. This will cause a compile error for the sort of bug that bit
you!
On 23 Feb 2006, at 2:18, Clark Cox wrote:
Maybe "-Weffc++" will help you.
On 2/22/06, Scott Fraser <email@hidden> wrote:
Is there a gcc compiler warning that would flag function call
arguments
that use a default copy constructor on an object-valued parameter? I
just spent way too much time debugging a problem where I
inadvertently
called a function with an object, instead of the address of the
object.
The default copy constructor did a shallow copy on entry to the
function. On exit, the destructor did a deep delete, removing the
entire tree that was being pointed to.
Talk about shooting myself in the foot! :-(
Scott
-----
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
--
Clark S. Cox III
email@hidden
My CV/Resume:
http://homepage.mac.com/clarkcox3/files/Resume.pdf
http://homepage.mac.com/clarkcox3/files/Resume.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40improvision.com
This email sent to email@hidden
Steve Baxter
Software Development Manager
Improvision
+44-2476-692229
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden