No we should not support enum types derived from strings
Adam D. Ruppe
destructionator at gmail.com
Fri May 7 15:33:56 UTC 2021
On Friday, 7 May 2021 at 15:25:30 UTC, Andrei Alexandrescu wrote:
> Enums derived from strings should not be supported as strings
> in the standard library.
I don't think the stdlib should special case much of anything.
Special casing enums is a mistake. If the user wants it treated
as a string, they can cast it to a string.
Special casing static arrays is a mistake. The user can just
slice it out the outside.
Special casing alias this is a mistake. The user can pass what
they meant to pass.
The phobos templates should work like all other templates - on
the exact type passed. Other functions work with the normal
overloading and implicit conversion rules.
Kill all the special cases!
More information about the Digitalmars-d
mailing list