On Sun, 17 Oct 2010 07:22:46 +0400, Steven Wawryk <[email protected]> wrote:

dsimcha wrote:
== Quote from Steven Wawryk ([email protected])'s article

C and C++ qualify.  I'm new to D and still learning about it, but with
the deprecation of scoped classes and delete, I'm not sure that D qualifies.
Why? The elimination of scope and delete just serves to uglyify the relevant concepts (which are unsafe and infrequently used) and save keywords. The concepts
can still be expressed:
 scope T -> std.typecons.scoped!T

Good - ugly is better than nothing. Can this be used for class members of struct's too?


delete foo -> foo.__dtor();  GC.free(cast(void*) foo);

If I wrote my own minimal run-time with no garbage collector I guess GC.free would be replaced by my own memory manager's free function. Does D allow me to hook my own allocation function into new?

New uses gc_malloc under the hood, override it and you should be fine.

Reply via email to