float init 0 request
Nick Treleaven
nick at geany.org
Sat Aug 22 09:37:46 UTC 2026
On Friday, 21 August 2026 at 20:54:25 UTC, Mindy Batek (0xEAB)
wrote:
> ```d
> int foo() const
> {
> for (auto next = (() @trusted => cast() this.next)(); next !is
> null; next = next.next)
> {
Surely that is incorrect to use `cast()`, because fields of
`next` could be mutated. Can't you just declare the node type
instead:
```d
const(Node)* next = this.next;
```
Though it would be nice if `auto` did that for you:
https://bugzilla-archive.dlang.org/bugs/7381/
More information about the Digitalmars-d
mailing list