draft proposal for Sum Types for D

H. S. Teoh hsteoh at qfbox.info
Tue Nov 29 20:18:02 UTC 2022


On Tue, Nov 29, 2022 at 09:10:56PM +0100, Timon Gehr via Digitalmars-d wrote:
> On 11/29/22 21:04, Walter Bright wrote:
[.[..]
> > I thought it mentioned that copy constructors, postblits, and
> > destructors are not allowed.
> 
> When the tag is managed by the language, you know which of those
> members to call under which circumstances, so this seems like an
> arbitrary limitation.

Supporting ctors, postblits, and dtors does increase the complexity of
the implementation.  Perhaps that can be left as a future extension?  In
any case, eventually we should support it; otherwise sumtypes will be
too limited in their usefulness.


T

-- 
Philosophy: how to make a career out of daydreaming.


More information about the Digitalmars-d mailing list