How to call a delegate held in a Variant array? I'm toying with some dynamic delegate code and wondered if i put a delegate in a Variant how would i call it?

class C
{
        private Variant[string] _methods;

        public void addMethod(T)(string name, T func)
        {
                this._methods[name] = func;
        }
}

auto obj = new C();

obj.addMethod("test", delegate(){
        return 34;
});

Now, how do i call the delegate held in 'this._methods["test"]'?

Reply via email to