[Issue 8424] Compile time conversions of double/floats to strings

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 10 23:58:08 UTC 2020


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

Witold Baryluk <witold.baryluk+d at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |witold.baryluk+d at gmail.com

--- Comment #5 from Witold Baryluk <witold.baryluk+d at gmail.com> ---
Any chance to make this come into phobos work with good tests? The D
implementation could also be faster possible that what it is trying to do now
(with snprintf, which does a lot of other stuff, including varags stuff, and
can't be optimized well by D compiler).

I had this issue:

bench.d(358):        called from here: to(bm(1LU, 18446744073709551615LU, null,
null, 0.1F))
bench.d(358):        while evaluating pragma(msg, "Generating benchmark code
for: bench.bm_pow_Dop_14 using default or user options: " ~ to(bm(1LU,
18446744073709551615LU, null, null, 0.1F)))


bm is a struct here that has a float and double fields, and I want to use
to!string on it during compile time for some compile time logging and error
messages when some conditions are wrong.

--


More information about the Digitalmars-d-bugs mailing list