Comment #0 by qs.il.paperinik — 2017-07-09T20:47:42Z
pure void main()
{
import std.format : formattedWrite;
auto app = appender!string;
app.formattedWrite!"%s"(1.0);
}
fails. formattedWrite can purely do its job for int and string. It should also do for floating point types.
Comment #1 by dlang-bugzilla — 2017-07-10T21:34:34Z
Missing:
import std.array : appender;
Seems to be impure because it calls snprintf (which I think may change FPU flags or something).
Comment #2 by greensunny12 — 2017-07-10T22:52:07Z
> which I think may change FPU flags or something
A hack would to create a pureSnprintf which resets errno to the value before its execution.
There are talks about doing this for free:
https://github.com/dlang/druntime/pull/1836