enum question

Adam D. Ruppe destructionator at gmail.com
Tue Mar 18 13:56:43 PDT 2014


On Tuesday, 18 March 2014 at 20:40:36 UTC, Eric wrote:
> However, using struct type seems inefficient because structs 
> are pass by value.

That's not necessarily a problem, especially if the struct is 
small, passing by value is faster than by reference.

What is your code trying to do?

> Can enums be made of classes yet, or is there a way to make the 
> enum based on structs more efficient?

enums can't be classes, but you could make a static class 
constructed at compile time and pass that reference around.


More information about the Digitalmars-d-learn mailing list