Re: strange looking ambiguity with type cast
Re: strange looking ambiguity with type cast
- Subject: Re: strange looking ambiguity with type cast
- From: jean-françois gauthier <email@hidden>
- Date: Wed, 11 Feb 2004 19:58:50 -0500
comments inserted below...
Le 11 fivr. 2004, ` 19:08, GoochRules! a icrit :
uh... why? As I know it, it is generally good practice to return/pass
references (except to local object, of course -- which we don't have
in this case) to avoid a spurious copy constructor call for the
temporary.
true enough, though my real class uses a copy-on-write scheme similar
to what Qt does with QString, QPtrList, etc.
remember that, in my original code snipet, i dont assign the value to
anything, so there really should be no constructor called. in my view,
this answers the next paragraph as well.
Point well taken, but until another argument is presented, I'd say its
a bug in your other compilers (or at least, another way of
interpreting the standard, but I'd say one way or another its a bug
somewhere).
I think the real issue is what you **WANT** to happen -- do you want
an 'a' created from an int or from a 'b'?
as said in my comment above, i have a b that i want converted to an a.
in my original example, {b _b ; (a) _b ;}, the only two things that
should be called in the second statement should be the conversion
method b :: operator a () and the destructor a :: ~a () as the
temporary object gets destroyed. or have misunderstood temporary
objects for years (it could be)? :)
jean-frangois
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.