digitalmars.D - Maybe allocator.dispose could nullify its parameter?
- Yuxuan Shui (9/9) Sep 15 2016 Looks like a reasonable thing to do, e.g.:
Looks like a reasonable thing to do, e.g.:
auto p = Mallocator.instance.make!ulong(0);
Mallocator.instance.dispose(p);
assert(p is null);
Proof of concept:
void disposeX(Allocator, T)(auto ref Allocator a, ref B b) {
a.dispose(b);
b = null;
}
Sep 15 2016








Yuxuan Shui <yshuiv7 gmail.com>