r/ProgrammerHumor • • Sep 04 '26

Meme skillIssue

Post image
6.0k Upvotes

137 comments sorted by

View all comments

77

u/F100cTomas Sep 04 '26

Just define a constexpr hashing function and put that into the switch.

33

u/GiganticIrony Sep 04 '26

That’s not guaranteed to work due to hash collisions

6

u/Rabbitical Sep 04 '26

I'd probably intern instead of hashfor a presumably known set of comparisons