algorithm.mutation.destroyAll: New

Fix #71.
This commit is contained in:
2018-10-29 11:14:33 +01:00
parent 64ceb0330c
commit 1e46109e50
3 changed files with 53 additions and 21 deletions

View File

@ -341,13 +341,7 @@ if (isPolymorphicType!T)
package(tanya) void[] finalize(T)(ref T[] p)
{
static if (hasElaborateDestructor!(typeof(p[0])))
{
foreach (ref e; p)
{
destroy(e);
}
}
destroyAll(p);
return p;
}