Trait for "can be instantiated"?
Ben Jones
fake at fake.fake
Tue May 10 16:10:26 UTC 2022
On Tuesday, 10 May 2022 at 16:05:15 UTC, H. S. Teoh wrote:
> Using wrapper structs, etc., for this is IMO total overkill.
> Just use an enum for your token types. Something like this
> would suffice:
That's basically what sumtype is going to do for me, but
(hopefully) more safely. Also, the token types are "user
defined," my lexer just grabs everything annotated with @Token
and passes those types/wrapped enums to sumtype.
More information about the Digitalmars-d-learn
mailing list