Eliminate "new" for class object creation?

Lionello Lunesu lio at lunesu.remove.com
Tue Oct 20 03:12:39 PDT 2009


On 20-10-2009 6:38, Andrei Alexandrescu wrote:
> I hereby suggest we get rid of new for class object creation. What do
> you guys think?

I don't agree with this one.

There's extra cost involved, and the added keyword makes that clear. 
Also, somebody mentioned using 'new' to allocate structs on the heap; 
I've never actually done that, but it sounds like using 'new' would be 
the perfect way to do just that.

L.



More information about the Digitalmars-d mailing list