T.init, struct destructors and invariants - should they be called?
    Stanislav Blinov 
    stanislav.blinov at gmail.com
       
    Sun Nov 18 14:54:05 UTC 2018
    
    
  
On Sunday, 18 November 2018 at 14:47:51 UTC, FeepingCreature 
wrote:
> On Sunday, 18 November 2018 at 14:38:09 UTC, Stanislav Blinov 
> wrote:
>> @safe unittest {
>>     Nullable!S a; // Look ma, no assert!
>> }
>
> a = S(new Object); // Look pa, assert!
That has to do with poor implementation of that example Nullable, 
not the union. opAssign should check for _hasValue.
    
    
More information about the Digitalmars-d
mailing list