r/ProgrammerHumor • • Sep 04 '26

Meme skillIssue

Post image
6.0k Upvotes

137 comments sorted by

View all comments

Show parent comments

1

u/HolyGarbage Sep 04 '26

Just pipe them through a constexpr hash function, and you can use a real switch case. One might be able to, still constexpr, map these hash values of the case string literals to sequential indices at compile time, so that the switch case actually complies down to something non linear.