[Semi-OT] to!string(enumType)

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Thu May 18 16:50:39 PDT 2017


On Thu, May 18, 2017 at 11:42:25PM +0000, Stefan Koch via Digitalmars-d wrote:
> On Thursday, 18 May 2017 at 22:31:47 UTC, Stefan Koch wrote:
> 
> > Granted this version will result in undefined behavior if you pass
> > something like (cast(ET) 3) to it.
> > But the 55x increase in compilation speed is well worth it :)
> 
> This code will replicate to!string behavior perfectly but will only take 30
> milliseconds to compile:
> 
> string enumToString(E)(E v)
> {
[...snip awesome stuff...]

Where's the PR? ;-)


T

-- 
Windows: the ultimate triumph of marketing over technology. -- Adrian von Bidder


More information about the Digitalmars-d mailing list