This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [setup] Why does PackageSpecification haveaprivatecopy-constructor? (Robert?)


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

Attachment: signature.asc
Description: This is a digitally signed message part


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]