This is the mail archive of the cygwin-apps 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: [PATCH] setup.exe SEGV on WinXP/Pro


Corinna Vinschen writes:
> Not quite.  ostringstream::str returns string, the string constructor
> implicitely returns string&.

I could be reading it wrong, but I don't think that's what the C++11
standard says should happen.  The implicit copy constructor transfering
the return value out of the function will treat the argument of the
return as an rvalue reference (but it'd do that just the same for
ostringstream::str, since that's simply how it is declared.

> It's sometimes tricky to wrap the brain
> around the differences as far as the scope is concerned.

It is true that the temporary object created by the explicit constructor
in the return statement is destroyed at the end of full-expression of
the return (12.2, 12.4).  But, the return statement itself has
initialization semantics, which means it operates as if a copy
constructor was invoked between the argument of the return and the
actual return value of the function (which in this case is a conversion
function, but I didn't find any hints in the standard that this would
somehow change semantics).


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Samples for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldSamplesExtra


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