variant visit not pure?

Dukc ajieskola at gmail.com
Thu May 7 13:38:02 UTC 2020


On Thursday, 7 May 2020 at 13:17:21 UTC, learner wrote:
> I've find this: https://issues.dlang.org/show_bug.cgi?id=16662

Hmm, that explains why it can't infer attributes. An unlimited 
variant could contain an object, and using it might or might not 
be <insert attribute here>.

Of course, it could still infer the attribute for algebraic types 
were the wrapper a bit smarter. But `Algebraic` is inferior to 
the DUB packages anyway. Bad performance like Simen said, and can 
always be `null` regardless of requested types. With 
Taggedalgebraic, you can insert `Void` to allowed types if you 
want `null` value but you don't have it just because.


More information about the Digitalmars-d-learn mailing list