On Tuesday, 29 December 2020 at 22:42:16 UTC, kdevel wrote:
Why is the enum to!string conversion so slow?
~~~slowenumtostringconversion.d
private enum S { A, B, C, D, };
[...]
one factor is all the template constraints that are evaluated
until the right std.conv.to overload gets selected.
Why is the enum to!string conversion so slow?
~~~slowenumtostringconversion.d
private enum S { A, B, C, D, };
version (fast) {
string resolve (E) (E e)
{
static foreach (m; __traits (allMembers, E))
if (e == __traits (getMember, E, m))
return m;
assert (fal