Make an enum idiomatic D - enhancing GNU Bison's Dlang support

Alexandru Ermicioi alexandru.ermicioi at gmail.com
Wed Sep 2 23:01:12 UTC 2020


On Wednesday, 2 September 2020 at 13:20:14 UTC, Adela Vais wrote:
> ...

You may try use a struct as enum type that holds both, order, and 
string message. Then you can have also toString method that will 
return your message during printing/or any string operation, 
while being used as value in rest of the cases through your code.

You may also make it immutable if needed.

- Alex.


More information about the Digitalmars-d mailing list