Fix InterfaceProxy when used with class instances.

This commit is contained in:
Sönke Ludwig 2017-01-27 00:51:22 +01:00
parent 71c83440d3
commit 3a3eb73006
No known key found for this signature in database
GPG key ID: D95E8DB493EE314C

View file

@ -81,7 +81,8 @@ struct InterfaceProxy(I) if (is(I == interface)) {
static assert(O.sizeof <= m_value.length, "Object ("~O.stringof~") is too big to be stored in an InterfaceProxy."); static assert(O.sizeof <= m_value.length, "Object ("~O.stringof~") is too big to be stored in an InterfaceProxy.");
import std.conv : emplace; import std.conv : emplace;
m_intf = ProxyImpl!O.get(); m_intf = ProxyImpl!O.get();
emplace!O(m_value[0 .. O.sizeof]); static if (is(O == struct))
emplace!O(m_value[0 .. O.sizeof]);
(cast(O[])m_value[0 .. O.sizeof])[0] = object; (cast(O[])m_value[0 .. O.sizeof])[0] = object;
} }