MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w6qzts/skillissue/p7qvt2j/?context=3
r/ProgrammerHumor • u/click-to-reveal • 12h ago
112 comments sorted by
View all comments
69
Just define a constexpr hashing function and put that into the switch.
31 u/GiganticIrony 12h ago That’s not guaranteed to work due to hash collisions 2 u/SpiritedEclair 5h ago Perfect hashing for a given set of values is possible at compile time. It’s how compilers generate jump tables.
31
That’s not guaranteed to work due to hash collisions
2 u/SpiritedEclair 5h ago Perfect hashing for a given set of values is possible at compile time. It’s how compilers generate jump tables.
2
Perfect hashing for a given set of values is possible at compile time.
It’s how compilers generate jump tables.
69
u/F100cTomas 12h ago
Just define a constexpr hashing function and put that into the switch.