Please improve the with statement by allowing initialisation

Dejan Lekic dejan.lekic at gmail.com
Thu Mar 13 14:48:00 UTC 2025


On Thursday, 13 March 2025 at 13:40:28 UTC, Sergey wrote:
> You can use `if`
> ```d
> if (auto win = new Window) {
> ...
> }
> ```

Yes, we discussed this on IRC.

I see no benefit as it is the same as

```d
auto win = new Window();
with (win) {
...
}

, and using if there is really confusing.


More information about the Digitalmars-d mailing list