I have made a discovery

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Sat Apr 18 19:42:28 PDT 2015


On Sun, 19 Apr 2015 00:50:23 +0000, weaselcat wrote:

> maybe I'm dumb in asking this, but if there was already an API for
> allocators in D... why is a std.allocator not being written ontop of it?
> it seems much more elegant to begin with.

ability to override `new` and `delete` is a big can of worms. c++ got 
into that, and now it's not recommended to touch that operators.

in a short: it's inflexible (you can't use two different `new` with one 
class, for example -- if not count the weirdo `new(5) A()` and such), you 
can't predict how your class will be allocated (yea, you didn't define 
`new` for your class... but one of it's parents did and... bam!) and so 
on.

so i fully understand why it's silently deprecated. yet i still don't 
want it to go. ;-)
-------------- 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/attachments/20150419/af5463ba/attachment-0001.sig>


More information about the Digitalmars-d mailing list