From b49593c334fb01d0370795f11750eda47f5b7257 Mon Sep 17 00:00:00 2001 From: Ilya Yaroshenko Date: Wed, 17 Apr 2019 16:18:43 +0700 Subject: [PATCH 1/2] Update mutation.d --- std/algorithm/mutation.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/std/algorithm/mutation.d b/std/algorithm/mutation.d index c8eb6735afc..6eaa2c35aa1 100644 --- a/std/algorithm/mutation.d +++ b/std/algorithm/mutation.d @@ -1411,8 +1411,8 @@ void moveEmplace(T)(ref T source, ref T target) @system memset(&source, 0, sz); else { - auto init = typeid(T).initializer(); - memcpy(&source, init.ptr, sz); + const init = T.init; + memcpy(&source, &init, sz); } } } From 09b71879289ea30554d9ea38c858c28886c306a6 Mon Sep 17 00:00:00 2001 From: Ilya Yaroshenko Date: Wed, 17 Apr 2019 16:58:43 +0700 Subject: [PATCH 2/2] Update mutation.d --- std/algorithm/mutation.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/std/algorithm/mutation.d b/std/algorithm/mutation.d index 6eaa2c35aa1..7e0370a3072 100644 --- a/std/algorithm/mutation.d +++ b/std/algorithm/mutation.d @@ -1411,7 +1411,7 @@ void moveEmplace(T)(ref T source, ref T target) @system memset(&source, 0, sz); else { - const init = T.init; + const T init; memcpy(&source, &init, sz); } }