D3 sumtype api

Paul Backus snarwin at gmail.com
Fri Feb 28 09:56:27 UTC 2025


On Friday, 28 February 2025 at 04:40:18 UTC, Jonathan M Davis 
wrote:
> On Thursday, February 27, 2025 6:06:01 PM MST Paul Backus via 
> dip.ideas wrote:
>> I'm currently working on Option!T for Phobos v3, and my plan 
>> is for it to use SumType internally.
>
> Why if it can only hold a single type? That just seems like 
> overkill and potentially unnecessary overhead.

Same reason Nullable!T currently uses a union internally instead 
of storing T directly. It handles edge cases like Option!T where 
T has `@disable this();`.


More information about the dip.ideas mailing list