Validity of cast(void*)size_t.max

Ali Çehreli acehreli at yahoo.com
Wed Feb 28 20:05:47 UTC 2018


On 02/28/2018 11:22 AM, Nordlöw wrote:
> On Tuesday, 27 February 2018 at 20:14:01 UTC, Ali Çehreli wrote:
>> And to be sure, one can have an actual object that represents nullness 
>> and use its pointer. (Similar to "the null object pattern".)
>>
>> Ali
> 
> Are there any pros to this pattern compared to just using `null` in D?

Instead of checking explicitly against null later on, you simply use the 
object and it has no side-effects. I've probably never used it myself 
but it sounds nice if it's applicable. :)

Ali


More information about the Digitalmars-d-learn mailing list