http://d.puremagic.com/issues/show_bug.cgi?id=8424

           Summary: Compile time conversions of double/floats to strings
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: m...@basgeertsema.net


--- Comment #0 from Bassieg <m...@basgeertsema.net> 2012-07-24 03:22:23 PDT ---
When converting a float to a string from within a mixin an error is given. 

Example:

import std.conv;
enum doubleString = mixin("to!string(0.6)");

Gives the following error:

..src\phobos\std\format.d(1355): Error: _snprintf cannot be interpreted at
compile time, because it has no available source code


The reason for the error is clear: _snprintf is an external function and can
therefore not be interpreted.

However, I think that compile-time conversion of floats to strings should be
supported. Perhaps the formatting code can be ported to the std library instead
of using an external function?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to