Enum literals, good? bad? what do you think?

Ali Çehreli acehreli at yahoo.com
Tue Jul 20 22:10:46 UTC 2021


On 7/20/21 2:52 PM, claptrap wrote:

 > The point is you should only be able to drop the enum name if the
 > parameter or the variable you're assigning to are ***named enums***.

Agreed. There wouldn't be name hijacking in that case. Either works 
helpfully or errors with a conflict.

 > I
 > suppose for switch you could do the same, if the variable being switched
 > on is a named enum, then the cases can drop the name.

Agreed with that as well. The type of the switch variable could hint the 
compiler.

Ali



More information about the Digitalmars-d mailing list