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!

Reply via email to