How do I do placement delete in D?

Steven Schveighoffer schveiguy at yahoo.com
Tue Dec 14 12:21:50 PST 2010


On Tue, 14 Dec 2010 15:18:32 -0500, Craig Black <craigblack2 at cox.net>  
wrote:

> I know emplace is used to do placement new.  What is the equivalent  
> placement delete?

x = emplace(yourAllocationFunction!T());

...

clear(x);
yourDeallocationFunction(x); // if necessary.  For instance, stack data  
doesn't need to be deallocated

-Steve


More information about the Digitalmars-d mailing list