What remains to be done for D2?

Petr Janda janda.petr at gmail.com
Mon Jun 13 23:55:14 PDT 2011


I see. Thank you.

I do have a couple of questions about myNew and myDelete though.

T ret = emplace!(T, Args)(objMem, args);
return ret; // return new custom allocated Object

So emplace runs the constructor of T.

1) Does emplace return a copy of T?
2) Is Object "ret"  constructed as a copy(via copy constructor) of
what emplace returns?
3) Is there some kind of internal reference counting/smart pointer
happening that I can't see?

And about myDelete:

core.stdc.stdlib.free(cast(void*)obj);

Casting object to a pointer to a heap allocated memory? That's neat!


More information about the Digitalmars-d mailing list