--- struct A {} auto a = cast (A*) malloc(A.sizeof); // Allocate emplace(a, 42); // Constructdestroy(a); // Destruct free(a); // Deallocate ---
Sorry for double posting, I failed at copy-paste, here's the correct example:
--- struct A { int i; } auto a = cast (A*) malloc(A.sizeof); // Allocate emplace(a, 42); // Construct destroy(a); // Destruct free(a); // Deallocate ---