Thoughts on some code breakage with 2.074

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Thu May 11 16:46:24 PDT 2017


On 5/11/17 7:12 PM, deadalnix wrote:
> On Thursday, 11 May 2017 at 12:26:11 UTC, Steven Schveighoffer wrote:
>> if(arr) -> same as if(arr.ptr)
>
> Nope. It is:
>
> if(arr) -> same as if(((cast(size_t) arr.ptr) | arr.length) != 0)
>
> Should we conclude from the fact that absolutely nobody gets it right in
> this very forum that nobody will get it right outside ? I'll let you judge.
>

But this still doesn't mean that *all* bool conversions are value based. 
In at least the struct and class cases, more than just the bits are checked.

-Steve


More information about the Digitalmars-d mailing list