Passing anonymous enums as function parameters

kerdemdemir kerdemdemir at hotmail.com
Wed Dec 20 12:14:25 UTC 2017


> enum
> {
>     a = "foo",
>     b = "bar",
>     c = "baz";
> }
>
> is identical to
>
> enum a = "foo";
> enum b = "bar";
> enum c = "baz";
>

Thanks Jonathan I think that changes my point of perspective.

And Jacob Carlborg I like the third option a lot with aliases 
good to know that

enum Foo : string
{
     KErdem
     Ali
     Zafer
     Salih
     //etc...
}

alias KErdem = Foo.KErdem
alias Ali = Foo.Ali
// etc...

Erdem


More information about the Digitalmars-d-learn mailing list