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

Robert Collins rbcollins@cygwin.com
Tue Aug 31 01:06:00 GMT 2004


On Mon, 2004-08-30 at 18:33 +0100, Max Bowsher wrote:
> I can't see why setup's PackageSpecification class has a private 
> copy-constructor.
> Am I missing something?

erm. to only allow the class itself to create copies.

> The reason why I am suddenly interested is that the C++ standard says that 
> this:
> 
> foo(SomeClass())
> 
> requires SomeClass's copy-constructor to be accessible (bizarre, no?) and 
> g++ 3.4 has decided to enforce this. 

Even if that is in a method:
SomeClass *
SomeClass::funkyCopy() const
{
  SomeClass *result(self);
}
?

> So, unless I can make the 
> copy-constructor public (which I don't want to do if doing so risks other 
> problems), I need to rewrite all code like:
> 
> do_something(PackageSpecification(somename))
> 
> to:
> 
> PackageSpecification tmppkgspec(somename);
> do_something(tmppkgspec);
> 
> which isn't very nice.

So we have code like that at the moment?

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/246d602c/attachment.sig>


More information about the Cygwin-apps mailing list