Beef
Beef copied to clipboard
[Enhancement] Dynamic casting
By dynamic casting, I mean to cast an object to a Type at runtime. Specifically being able to cast it to an interface that can be passed to a constructor invoked at runtime.
Something like this?
(T*)Internal.UnsafeCastToPtr(xy);
No, not generic. I meant using a Type object. Like typeof(T)
@bfiete You could close this as dynamic casting it provided by Variants.
BaseItem item;
Item itemImpl = scope .();
Variant variant = Variant.Create(typeof(BaseItem), &itemImpl);
item = variant.Get<BaseItem>(); // or Get<Object>()