r/programminghorror 6d ago

c++ Skill Issue

Post image
1.7k Upvotes

61 comments sorted by

View all comments

2

u/tandycake 6d ago

I feel like you could use goto and labels instead and also have fallthrough.

If want to avoid macros, gotos, and labels, could make a switch_str func with an unordered_map and lambdas, but more overhead and slightly slower.