On Sunday, August 27, 2017 22:01:52 Michael Reiland via Digitalmars-d-learn
wrote:
> whoa, you can use a struct as a basetype for an enum? I'm
> guessing it allows you to associate more information with the
> enum without using lookup tables and the like? And equality is
> probably just a
whoa, you can use a struct as a basetype for an enum? I'm
guessing it allows you to associate more information with the
enum without using lookup tables and the like? And equality is
probably just a memberwise comparison of the struct itself?
That seems interesting like an interesting idea,
On Sunday, August 27, 2017 03:47:58 Michael Reiland via Digitalmars-d-learn
wrote:
> You can randomly assign a string to an enum? Or am I
> misunderstanding that last bit of code?
No, you can't directly assign a string to an enum of type string. That's
part of why they don't pass isInputRange.
You can randomly assign a string to an enum? Or am I
misunderstanding that last bit of code?
Also it sounds to me like string enums are going to be slower
performance wise than integer enums.
On Sunday, August 27, 2017 01:43:14 Michael Reiland via Digitalmars-d-learn
wrote:
> Hey guys,
>
> I was running through a tutorial and I noticed that enums can
> have a base type of string. Which is interesting, but I'm
> wondering about comparisons.
>
> I'm guessing the comparison boils down
Hey guys,
I was running through a tutorial and I noticed that enums can
have a base type of string. Which is interesting, but I'm
wondering about comparisons.
I'm guessing the comparison boils down to a pointer comparison,
but I thought I'd confirm.