Optional type - how to correctly reset a wrapped immutable T

jmh530 john.michael.hall at gmail.com
Mon Mar 26 21:17:10 UTC 2018


On Sunday, 25 March 2018 at 21:26:57 UTC, aliak wrote:
> Hi, I have this optional type I'm working on and I've run in to 
> a little snag when it comes to wrapping an immutable. Basically 
> what I want is for an Optional!(immutable T) to still be 
> settable to "some" value or "no" value because the Optional 
> wrapper itself is mutable.
>
[snip]

You might look at the source for std.typecons.Nullable. They use 
an inout constructor.


More information about the Digitalmars-d-learn mailing list