Proposal for dual memory management

Petr Janda janda.petr at gmail.com.au
Tue Jul 27 22:19:07 PDT 2010


You said:
Foo f2 = create!Foo(f2)

But I don't like the fact that f2 is mentioned twice.

I would prefer the exact same behaviour as C++:

Class* c = new Class(); // allocate on the umanaged heap and run the default constructor
delete c; // run destructor and deallocate

objects to be allocated on the garbage collected heap would be constructed this way:
Class c = Class.new() // delete c would be illegal

Simple and logical to me, unfortunately TDPL has been written and everyone would be using "new Class()" instead of "Class.new()" :(

Petr


More information about the Digitalmars-d mailing list