deprecated delete and manual memory management
KennyTM~
kennytm at gmail.com
Wed Apr 27 13:56:39 PDT 2011
On Apr 28, 11 04:28, Daniel Gibson wrote:
> It'd create template bloat and uglier syntax (expecially confusing for
> people coming from about any other popular OO language) for a really
> common, standard feature.
> These drawbacks are acceptable for custom allocation and other stuff the
> average user shouldn't care about, but not for an elemental feature like
> "new".
>
> Cheers,
> - Daniel
Er elemental? If 'new' is deprecated then a 'class' and 'array' will be
constructed with
class K { ... }
auto k = K(...); // no new
auto a = int[] (k.length); // no new
same as how a 'struct' is constructed now. The only situation left where
'new!T()' is really necessary is when you need to create a T* on heap
(GC.malloc) e.g.
int* ps = new!int(4);
I fail to see this is elemental in D.
More information about the Digitalmars-d
mailing list