DMD 2.092 and DIP 25
Mike Parker
aldacron at gmail.com
Sun May 31 04:04:54 UTC 2020
On Saturday, 30 May 2020 at 16:14:34 UTC, Steven Schveighoffer
wrote:
>
> This is not about const or not, it's about lifetime management.
>
> For example, this would return a pointer to a stack frame that
> is about to go away:
>
> const(char)* foo()
> {
> ErrorInfo info;
> return info.message;
> }
>
> I know that you have already fixed the problem, but I wanted to
> make sure you understood why the compiler is complaining.
Yes, that was me having never actually read DIP 25 and
misunderstanding what it was about. I've since been educated.
Thanks!
More information about the Digitalmars-d-learn
mailing list