Re: Comparison of Enumerations with base type of String?

2017-08-27 Thread Jonathan M Davis via Digitalmars-d-learn
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

Re: Comparison of Enumerations with base type of String?

2017-08-27 Thread Michael Reiland via Digitalmars-d-learn
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,

Re: Comparison of Enumerations with base type of String?

2017-08-26 Thread Jonathan M Davis via Digitalmars-d-learn
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.

Re: Comparison of Enumerations with base type of String?

2017-08-26 Thread Michael Reiland via Digitalmars-d-learn
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.

Re: Comparison of Enumerations with base type of String?

2017-08-26 Thread Jonathan M Davis via Digitalmars-d-learn
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

Comparison of Enumerations with base type of String?

2017-08-26 Thread Michael Reiland via Digitalmars-d-learn
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.