Honestly I'm always both super confused & impressed by what C++ templates can do. Here's a way to replace a switch statement with a recursively applied template: stackoverflow.com/a/39830812/5720002
Useful if you would have to have many of those kinds of switch statements
Allowed me to replace these huge case blocks with a bit of template boilerplate