[setup] Why does PackageSpecification have aprivatecopy-constructor? (Robert?)
Robert Collins
rbcollins@cygwin.com
Tue Aug 31 13:52:00 GMT 2004
On Tue, 2004-08-31 at 14:27 +0100, Max Bowsher wrote:
> Robert Collins wrote:
> >
> > which is public, and should be usable.
>
> See: http://gcc.gnu.org/bugs.html#cxx_rvalbind
>
> I agree with you, but the C++ Standard and GCC 3.4 disagree with both of us.
Eek.
> > 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.
>
> Why is this something that isn't meant to happen?
Because I hadn't written an explicit copy-constructor.
> > You could certainly make it public and implement it if you choose.
>
> Do I need to implement it? AFAICS the implicit copy-constructor should be
> ok - am I wrong?
the implicit one will work, but an explicit one would be good practice
here IMO. Thats because we have a pointer (_operator) that isn't
actually foreign storage, and explicitly copying the pointer, not the
contents may make the intent clear.
> > However, showing the error you get might be more useful...
Thanks.
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/74b37c4d/attachment.sig>
More information about the Cygwin-apps
mailing list