Returning a ref to a temporary already possible?

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Oct 23 04:38:22 PDT 2014


On Thu, 23 Oct 2014 14:36:17 +0300
ketmar via Digitalmars-d-learn <digitalmars-d-learn at puremagic.com>
wrote:

> On Thu, 23 Oct 2014 16:55:52 +0530
> Shriramana Sharma via Digitalmars-d-learn
> <digitalmars-d-learn at puremagic.com> wrote:
> 
> > I'd really like to know what's exactly happening in that line:
> > 
> > auto P = Pair(1, 2).handle ;
> object moving. add postblit (`this (this)`) and you'll see that.
or, to be precise, object *copying*. it's not the same as creating new
object. if you'll add destructor, you'll see that destructor is called
twice: once for local copy and once for P.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20141023/77d0717d/attachment.sig>


More information about the Digitalmars-d-learn mailing list