A coworker asked about the idiomatic way to get the hash of a string in D, and somewhat surprisingly the best answer I could find is: "to get the hash of an lvalue x, call typeof(x).getHash(&x)."

That's admittedly quite clunky and indirect. Is it worth it to simplify that by means of a template in object.di?


Andrei

Reply via email to