This is the mail archive of the
cygwin-apps@cygwin.com
mailing list for the Cygwin project.
Re: [setup] Why doesPackageSpecificationhaveaprivatecopy-constructor? (Robert?)
- From: "Max Bowsher" <maxb at ukf dot net>
- To: "Robert Collins" <rbcollins at cygwin dot com>
- Cc: "Cygwin Apps" <cygwin-apps at cygwin dot com>
- Date: Wed, 1 Sep 2004 19:11:39 +0100
- Subject: Re: [setup] Why doesPackageSpecificationhaveaprivatecopy-constructor? (Robert?)
- References: <039401c48eb7$bcb75f70$78d96f83@robinson.cam.ac.uk> <1093914414.10698.56.camel@localhost> <001601c48f2f$cc7d38d0$78d96f83@robinson.cam.ac.uk> <1093941341.21210.48.camel@localhost> <022e01c48f5e$523f3b70$78d96f83@robinson.cam.ac.uk> <1093960377.22450.22.camel@localhost> <008201c48fab$dc3a89e0$78d96f83@robinson.cam.ac.uk> <1093998577.22450.25.camel@localhost> <000f01c48ff3$06a7ed70$78d96f83@robinson.cam.ac.uk> <1094023529.19050.50.camel@localhost>
Robert Collins wrote:
On Wed, 2004-09-01 at 08:12 +0100, Max Bowsher wrote:
Robert Collins wrote:
Have you heard of the 'rule of 3' ?
No. Apparently I need to do some reading.
http://www.parashift.com/c++-faq-lite/coding-standards.html#faq-27.9
"A class with any of {destructor, assignment operator, copy constructor}
generally needs all 3"
After that, and further googling, I fully agree with the rule of 3.
However, it appears to me that PackageSpecification needs none of these.
copy-constructor: Was private, now gone.
destructor: Is currently present, but a no-op.
assignment operator: Is present and bizarre...
...in that it only assigns the name, not the operator or version!
This seems like a bug to me - and the only reason we haven't bumped into it
before, is because we haven't begun to use versioned dependencies.
So, unless there's something I'm not seeing, the destructor and operator=
can be removed too.
Max.