Editions Ideas
Derek Fawcus
dfawcus+dlang at employees.org
Sun Dec 14 17:22:12 UTC 2025
On Sunday, 14 December 2025 at 11:44:32 UTC, Paul Backus wrote:
> For example, instead of using -preview=dip1000 we can simply
> forbid @safe code from taking the address of a stack-allocated
> variable (passing by `ref` is fine though).
Not for me. I prefer passing by pointer, including of stack
variables.
That simply because it makes it explicit at the call site that a
reference has been made, and provided to the called routine.
Hence one is able to comprehend the potential effects of a call
using local knowledge only.
Thus why I actually liked the addition of the scope qualifier to
re-enable such explicit pointer passes in @safe code.
DF
More information about the Digitalmars-d
mailing list