Tagged enums why reserved words are not permitted ?

Gary Willoughby via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Oct 28 09:58:50 PDT 2014


On Tuesday, 28 October 2014 at 00:51:17 UTC, Jonathan M Davis via 
Digitalmars-d-learn
> The
> thing that's been done in Phobos in this type of situation is 
> to put an
> underscore on the end of the keyword, so you'd get
>
> enum CrudOps { read, write, delete_ }
>
> and while that may not be what you want, it's pretty much the 
> best that you
> can do.
>
> - Jonathan M Davis

This is also mentioned in the style guide too.

http://dlang.org/dstyle.html


More information about the Digitalmars-d-learn mailing list