null and initialized string comparisons

Adam D. Ruppe destructionator at gmail.com
Wed Feb 17 21:16:00 UTC 2021


On Wednesday, 17 February 2021 at 20:48:22 UTC, Martin wrote:
> is this how it supposed to be? (https://run.dlang.io/is/7B4irm)

== compares contents. Both null and "" have empty contents and 
are interchangable for operators that work on contents.

The assert just looks at the pointer, not contents. The `is` 
operator also looks at pointer (and length).


More information about the Digitalmars-d-learn mailing list