On Monday, 14 August 2017 at 13:11:20 UTC, Steven Schveighoffer
wrote:
Another reasonable idea is to have the compiler call the
function for you.
Yeah, I was thinking that too. Heck, the compiler prolly uses it
for reading source and writing errors.
Perhaps just special case hack the functio
On 8/13/17 11:44 PM, Adam D. Ruppe wrote:
On Monday, 14 August 2017 at 01:52:16 UTC, Johnson Jones wrote:
pretty simply, trying to convert a floating point to a string in a
ctfe function and it thinks that it is too complex to do in a ctfe,
really?
It uses a C function to do the conversion, w
On Monday, 14 August 2017 at 04:29:17 UTC, Johnson wrote:
```
auto valueToString(alias v)(){return v.stringof;}
enum a = valueToString!(0.75);
static assert(a == "0.75");
```
Thanks! You'd think that to would do this internally
automatically ;/
It only works on literals.
valueToString!(a) wil
On Monday, 14 August 2017 at 03:52:40 UTC, HypperParrow wrote:
On Monday, 14 August 2017 at 01:52:16 UTC, Johnson Jones wrote:
Error: uncaught CTFE exception
std.format.FormatException("Cannot format floating point types
at compile-time")
called from here: to(0.75)
pretty simply, trying to co
On Monday, 14 August 2017 at 03:44:27 UTC, Adam D. Ruppe wrote:
On Monday, 14 August 2017 at 01:52:16 UTC, Johnson Jones wrote:
pretty simply, trying to convert a floating point to a string
in a ctfe function and it thinks that it is too complex to do
in a ctfe, really?
It uses a C function t
On Monday, 14 August 2017 at 01:52:16 UTC, Johnson Jones wrote:
Error: uncaught CTFE exception
std.format.FormatException("Cannot format floating point types
at compile-time")
called from here: to(0.75)
pretty simply, trying to convert a floating point to a string
in a ctfe function and it th
On Monday, 14 August 2017 at 01:52:16 UTC, Johnson Jones wrote:
pretty simply, trying to convert a floating point to a string
in a ctfe function and it thinks that it is too complex to do
in a ctfe, really?
It uses a C function to do the conversion, which is not available
at compile time sinc
Error: uncaught CTFE exception std.format.FormatException("Cannot
format floating point types at compile-time")
called from here: to(0.75)
pretty simply, trying to convert a floating point to a string in
a ctfe function and it thinks that it is too complex to do in a
ctfe, really?