draft proposal for Sum Types for D

Steven Schveighoffer schveiguy at gmail.com
Tue Nov 29 17:05:11 UTC 2022


On 11/29/22 9:56 AM, Timon Gehr wrote:
> On 11/29/22 14:45, rikki cattermole wrote:
>>
>> "Members of sumtypes cannot have copy constructors, postblits, or 
>> destructors."
>>
>> Kills reference counting, can't use it. Can't use it for value typed 
>> exceptions as the underlying sum type implementation. Not good enough. 
>> Note when these are not defined you can optimize the copying to be 
>> just mov's.
>>
> 
> Oof. Missed that bit. Yes, that limitation won't fly. This must be 
> supported.
> 

Yeah, I wanted to bring this up too. This has to work, and is probably 
the trickiest complication that libraries like std.sumtype solve.

A question here: is this intended to obsolete or trivialize the 
std.sumtype library?

-Steve


More information about the Digitalmars-d mailing list