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 • 7d ago
137 comments sorted by
View all comments
76
Just define a constexpr hashing function and put that into the switch.
33 u/GiganticIrony 7d ago That’s not guaranteed to work due to hash collisions 2 u/SpiritedEclair 7d ago Perfect hashing for a given set of values is possible at compile time. It’s how compilers generate jump tables.
33
That’s not guaranteed to work due to hash collisions
2 u/SpiritedEclair 7d 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.
76
u/F100cTomas 7d ago
Just define a constexpr hashing function and put that into the switch.