Enum of functions?

Chris Williams yoreanon-chrisw at yahoo.co.jp
Mon Nov 25 19:01:36 PST 2013


On Tuesday, 26 November 2013 at 00:27:25 UTC, IgorStepanov wrote:
> You can write
>
> enum Foo : void function()
> {
>     WOMBAT = function void () {writeln("Wombat");}
> }
>
> or
>
> enum Foo
> {
>     WOMBAT = function void () {writeln("Wombat");}
> }
>
> `() {writeln("Wombat");}` literal recognized by compiler as 
> delegate, not function.

Thank you. It looks like 2.063 only handled the first case (and 
only if there was a single entry), but with 2.064 it works 
perfectly.



More information about the Digitalmars-d-learn mailing list