The bug you need to fix is here. Result is of type `Unqual!E`. the emplace needs to be change to that (or just be called "raw", that works too):
```D
emplace(result.ptr + i, e);
```