News for hackers. Stuff that matters.
Re:Cttrie – Compile-time trie-based string matching for C++ by convivialdingo on Friday September 14, 2018 @12:31PM (#17988593)
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...

There are no comments on this comment yet.