Static function as member delegate's initial value?
OpenJelly via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Mon Jun 20 06:20:04 PDT 2016
I've got a delegate as a member of a class and I want to give it
a default value. I can assign it an initial value in each
initializer of the class but I'd like to make my code more
readable and assign it a function at the declaration.
Trying to toDelegate the situation gives me the following Error:
Error: dummyDel.funcptr cannot be evaluated at compile time
Is there a workaround? Or am I stuck assigning my default
function to the delegate in each initializer?
More information about the Digitalmars-d-learn
mailing list