SumType extraction
Josh Holtrop
jholtrop at gmail.com
Sat Jun 29 00:54:02 UTC 2024
On Friday, 28 June 2024 at 22:25:40 UTC, drug007 wrote:
> Both yes and no, you check the type once, but then check for
> null, so a double check is performed nonetheless. But for me
> it's a minor difference.
>
> There are two common ways to handle sumtypes: using either an
> explicit type tag or implicit type handling. Both have their
> pros and cons. As I know (can be wrong) std.sumtype implies
> type handlers not type tags.
Ah, I see what you're saying. I suppose if performance was more
important I would do this a different way. I'm mainly going for
the more concise syntax for this application. Thanks!
More information about the Digitalmars-d-learn
mailing list