Getting a safe path for a temporary file
Jonathan M Davis
newsgroup.d at jmdavisprog.com
Sat Oct 28 03:46:30 UTC 2017
On Friday, October 27, 2017 21:38:55 Jonathan M Davis via Digitalmars-d-
learn wrote:
> Also, toStringz specifically returns an immutable(char)* - though looking
> it over right now, I'd say that that's a bug for the overload that takes
> const(char)[] instead of string. It really should return const(char)* in
> that case.
Actually, looking it over again, the return type is fine. That's the
overload that always allocates a new string (since it assumes that the array
could not have been from a string literal, since that would be a string and
would go to the other overload), so even though the argument could have been
const or mutable, what's returned is a pointer to a string, so
immutable(char)* is correct.
But https://issues.dlang.org/show_bug.cgi?id=15136 is still a problem for
the other overload.
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list