March 21

On Thursday, 21 March 2024 at 09:16:07 UTC, Andrea Fontana wrote:

>

This?

auto toHex(N)(N number) if (isIntegral!N) { return "%X".format(number); }

No, you respect your efforts. Simple solutions without memory allocation are needed. Moreover, there are already very good algorithms in the runtime:

https://github.com/dlang/dmd/blob/master/druntime/src/core/internal/string.d#L34

SDB@79

1 2
Next ›   Last »