[setup] Why does PackageSpecification have a privatecopy-constructor? (Robert?)

Robert Collins rbcollins@cygwin.com
Tue Aug 31 08:35:00 GMT 2004


On Tue, 2004-08-31 at 08:54 +0100, Max Bowsher wrote:
> > So we have code like that at the moment?
> 
> Certainly. 4 occurrences in IniDBBuilderPackage.cc and 1 in package_db.cc.

Eh? I can't find any. We have things like
setSourcePackage(PackageSpecification(name));


which at the end of the call chain does:
_packageversion::setSourcePackageSpecification(PackageSpecification
const &aSpec)
{
  _sourcePackage=aSpec;
}

which should not invoke the copy contructor. rather it is the assignment
operator.
 PackageSpecification &operator= (PackageSpecification const &);

which is public, and should be usable.

gcc 3.x have all honoured the privateness of Foo aFoo(Foo());, and
whatever warning you are getting is probably correct.

As to the privateness of the copy constructor, I didn't comment it, but
neither did I implement it: thats an idiom I use, to cause compiler
errors when someone tries to do something that they aren't meant to.

You could certainly make it public and implement it if you choose.
However, showing the error you get might be more useful...

Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20040831/a78a31c5/attachment.sig>


More information about the Cygwin-apps mailing list