Skip to content

Commit fcff98d

Browse files
authored
core.memory.__delete instead of deprecated delete for newer compilers (#62)
1 parent 6e0c49e commit fcff98d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

source/scid/core/memory.d

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,15 @@ if(Appends!(T, U)) {
155155
auto oldPtr = to.ptr;
156156
to ~= from;
157157
if (oldPtr != to.ptr)
158-
delete oldPtr;
158+
{
159+
static if (__VERSION__ >= 2079)
160+
{
161+
import core.memory : __delete;
162+
__delete(oldPtr);
163+
}
164+
else
165+
delete oldPtr;
166+
}
159167
}
160168

161169
unittest {

0 commit comments

Comments
 (0)