[Issue 12448] "in" argument for std.string.toStringz

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Jul 13 03:06:55 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=12448

Jonathan M Davis <jmdavisProg at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg at gmx.com

--- Comment #10 from Jonathan M Davis <jmdavisProg at gmx.com> ---
There is no guarantee that the result of toStringz does not escape the
function, so using in for parameter to toStringz would be fundamentally wrong,
since in implies scope. And since scope hasn't been fully implemented, the
problem wouldn't even be caught. Rather, we risk ending up with such code
breaking when scope actually gets fully implemented - which is why I'd argue
that using in is almost always bad. We should just avoid using scope and in
until they're properly implemented IMHO.

--


More information about the Digitalmars-d-bugs mailing list