Interface "indexing"
cym13 via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Sep 6 11:49:41 PDT 2015
On Sunday, 6 September 2015 at 18:16:02 UTC, Prudence wrote:
> On Sunday, 6 September 2015 at 18:11:44 UTC, Kagamin wrote:
>> [...]
>
> Yes, I suppose an array would work, but realize that since enum
> is a compile time construct, the dynamic array is not
> necessary. And since your factories are all the time and always
> will be(if you change anything you have to refactor a lot of
> stuff).
>
> It seems all this stuff could be simplified a great deal. And
> no one said you wouldn't have a switch. I'm not talking about
> creating some tycheyon particles. I'm simply talking about some
> way to hide the details(which, could be done with a string
> mixin but at the cost of not being able to parse them and debug
> them well).
As you can do an enum with any type, why not an enum of factory?
More information about the Digitalmars-d-learn
mailing list