Keyword to avoid not null references

Namespace rswhite4 at googlemail.com
Sun Apr 22 01:04:13 PDT 2012


On Sunday, 22 April 2012 at 00:06:47 UTC, Adam D. Ruppe wrote:
> Made the data member private.

But if the struct is in a separate module you get an error.
So you must write

T get() {
	return this._notNullData;
}
	
alias get this;

instead

alias _notNullData this; /// this is substitutable for the 
regular (nullable) type



More information about the Digitalmars-d-learn mailing list