Hacker News new | ask | show | jobs
by convivialdingo 2837 days ago
Something we’ve used before is preprocessor string hashing similar to [1]. Basically we hash strings at compile time to ints and use those for our case statements. Word of caution though, there’s the possibility of collisions. It works great on a limited set of strings like XML tags and such.

1. http://lolengine.net/blog/2011/12/20/cpp-constant-string-has...