Am Mon, 23 Sep 2013 18:36:57 +0200 schrieb Andrej Mitrovic <[email protected]>:
> On 9/23/13, Johannes Pfau <[email protected]> wrote: > > New should then be considered as deprecated and replaced by > > create!(GCAllocator, Class)(). > > What? That's never gonna happen. For one thing, it looks ugly as hell. > And for another, it's going to break everything written in D. That's why I say "considered" and not really deprecated. But if you want to / have to write allocator aware code which can use the GC it's a nice solution: auto list(Payload, Allocator = GCAllocator)() { create!(Allocator) ... } Of course the API should be improved. For example create could default to the GC allocator. Then it's "auto a = new Class(...)" vs "auto a = create!Class(...)". But IIRC when emplace was first implemented and class allocators were removed it was quite clear that new could be easily replaced by a template function and has no real place as a builtin anymore. It's just too late to remove it.
