Thread overview
[Issue 13055] @nogc std.string.sformat
Jan 10, 2016
Timothee Cour
Jul 14, 2016
Lodovico Giaretta
Jul 14, 2016
Lodovico Giaretta
Feb 13, 2021
Walter Bright
Dec 17, 2022
Iain Buclaw
July 11, 2014
https://issues.dlang.org/show_bug.cgi?id=13055

--- Comment #1 from bearophile_hugs@eml.cc ---
One of my intended usages for this function is to generate messages for exceptions in @nogc code. Chris Cain comments:

> It's just stack-allocated this way isn't possible since the exception can be thrown into a scope above your stack allocated chars.

--
January 10, 2016
https://issues.dlang.org/show_bug.cgi?id=13055

Timothee Cour <timothee.cour2@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timothee.cour2@gmail.com

--- Comment #2 from Timothee Cour <timothee.cour2@gmail.com> ---
ping.
just ran into this again
http://forum.dlang.org/thread/mailman.3496.1452412496.22025.digitalmars-d@puremagic.com
formatted assert error messages inside nogc functions

--
July 14, 2016
https://issues.dlang.org/show_bug.cgi?id=13055

TeddyBear12311@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |TeddyBear12311@gmail.com

--- Comment #3 from TeddyBear12311@gmail.com ---
Same problem ;/

--
July 14, 2016
https://issues.dlang.org/show_bug.cgi?id=13055

Lodovico Giaretta <lodovico@giaretart.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lodovico@giaretart.net

--- Comment #4 from Lodovico Giaretta <lodovico@giaretart.net> ---
The current sformat signature is:

char[] sformat(Char, Args...)(char[] buf, in Char[] fmt, Args args)
{
     // something that uses encode(...)
}

It should become:

char[] sformat(Char, Args...)(char[] buf, in Char[] fmt, Args args)
{
    return sformat!(UseReplacementDchar.no)(buf, fmt, args);
}
char[] sformat(UseReplacementDchar urd, Char, Args...)(char[] buf, in Char[]
fmt, Args args)
{
    // something that uses encode!urd(...)
}

So that current behaviour does not change and one can opt-in for the @nogc version.

--
July 14, 2016
https://issues.dlang.org/show_bug.cgi?id=13055

--- Comment #5 from Lodovico Giaretta <lodovico@giaretart.net> ---
Also, the current use of enforce inside sformat (which a comment states shall be removed) should be converted to an assert or something else that does not throw.

--
February 13, 2021
https://issues.dlang.org/show_bug.cgi?id=13055

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=3248

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=13055

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
December 01
https://issues.dlang.org/show_bug.cgi?id=13055

--- Comment #6 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/phobos/issues/10069

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--