From b160f80af6f58b48b2c7f98f11c59e01caac75b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Sat, 14 Nov 2020 09:42:05 +0100 Subject: [PATCH] Avoid instantiating emplace(O) for class instances. Fixes a deprecation warning for ProxyStream. --- source/vibe/internal/interfaceproxy.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/vibe/internal/interfaceproxy.d b/source/vibe/internal/interfaceproxy.d index 47d6ad1..79dcf97 100644 --- a/source/vibe/internal/interfaceproxy.d +++ b/source/vibe/internal/interfaceproxy.d @@ -163,7 +163,7 @@ struct InterfaceProxy(I) if (is(I == interface)) { import std.conv : emplace; clear(); m_intf = ProxyImpl!O.get(); - if (is(O == class)) + static if (is(O == class)) (cast(O[])m_value[0 .. O.sizeof/m_value[0].sizeof])[0] = object; else emplace!O(m_value[0 .. O.sizeof/m_value[0].sizeof]); swap((cast(O[])m_value[0 .. O.sizeof/m_value[0].sizeof])[0], object);