Re: dmd: enum to!string slows down compilation

2020-12-29 Thread Basile B. via Digitalmars-d-learn
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.

dmd: enum to!string slows down compilation

2020-12-29 Thread kdevel via Digitalmars-d-learn
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