BobR wrote:
When are anonymous enums preferred over named enums? Maybe they are in the language for historical reasons? Or are they truly useful enough to warrant having a 2 kinds of enums?


I use them to create D bindings to C libraries. They are useful for translating both C enums and #defines. Plus, if porting C++ code they make a good tool for translating global constants. Also, and this is a big one for me, anonymous enums generate no TypeInfo, which can save a lot of space in the binary over named enums.

Reply via email to