Add interfaceProxy function to allow for better vibe:core compatibility.

This commit is contained in:
Sönke Ludwig 2017-01-26 23:53:18 +01:00
parent 5249c1c4c6
commit 822dcccf34
No known key found for this signature in database
GPG key ID: D95E8DB493EE314C

View file

@ -8,6 +8,8 @@ import std.traits : BaseTypeTuple;
O asInterface(I, O)(O obj) if (is(I == interface) && is(O : I)) { return obj; } O asInterface(I, O)(O obj) if (is(I == interface) && is(O : I)) { return obj; }
InterfaceProxyClass!(I, O) asInterface(I, O)(O obj) if (is(I == interface) && !is(O : I)) { return new InterfaceProxyClass!(I, O)(obj); } InterfaceProxyClass!(I, O) asInterface(I, O)(O obj) if (is(I == interface) && !is(O : I)) { return new InterfaceProxyClass!(I, O)(obj); }
InterfaceProxy!I interfaceProxy(I, O)(O o) { return InterfaceProxy!I(o); }
private class InterfaceProxyClass(I, O) : I private class InterfaceProxyClass(I, O) : I
{ {
import std.meta : AliasSeq; import std.meta : AliasSeq;