Daniel Keep: > Because: > > > struct NonNullable(T) > > { > > T ptr; > > alias ptr this; > > > > this(T ptr) > > { > > assert(ptr !is null); > > this.ptr = ptr; > > } > > this(NonNullable!T ptr) > > { > > this.ptr = ptr.ptr; > > } > > } > > > > // Boom! I just broke your non-nullable type! > > NonNullable!Object o;
I am sorry, but I don't understand still. That's valid D2 code, and I can understand it. But from its look it seems (beside the not handy syntax, it's not as adding a "?") the opposite of what I was saying (that by default all D objects have to be non-nullable). Can you please help me understand? :-) Bye, bearophile