On Sunday, 3 January 2021 at 02:41:12 UTC, Paul wrote:

I haven't used hashOf before, though assuming no equal values, which I generally wouldn't do, I take it this is reliable? I haven't tried it before, and I dont know how to effectively compare it to using 'switch(w.to!string)' & 'case Wind.B.stringof' (regarding speed/reliability).

hashOf is not guaranteed to produce unique values, so I would not advise using it here.

to!string is expensive both at compile time (requires a lot of template instantiations) and runtime (needs to allocate memory for the string). It will work if you need to hack something together quickly, but I would not recommend it for "serious" code.

Reply via email to