May 01, 2018
Is there a way to convert a `double` to a `string` in a `pure` function?

I tried

@safe pure unittest
    import std.conv : to;
    const y =!string;

but it fails to compile as

`pure` function `foo.__unittest_L1_C12` cannot call impure function `!!`

Have anybody wrapped the corresponding C solution via, snprintf or gcvt in a high-level D wrapper?

Is assume `gcvt` is GNU only but that's ok with me. I assume `gcvt` is faster than `snprintf` in this case.