On Tuesday, 12 July 2022 at 16:40:38 UTC, H. S. Teoh wrote:
On Tue, Jul 12, 2022 at 04:27:44PM +0000, Antonio via Digitalmars-d-learn wrote:
It works

```d
void main()
{
   assert(null=="");
}
```

why?

Because an empty string is, by default, represented by an empty slice of the null pointer.

Do not rely on this, however;

Absolutely. I'd like to add: especially as default parameter value that's an array. Never use null. use `[]` (empty array literal).

Reply via email to