Here's a very clean and clever NES emulator in C++ by Bisqwit of TAS fame:
https://www.youtube.com/watch?v=y71lli8MS8s
He presents the code in the style of a tool assisted run, typing it in in high speed. I never saw templates used like that to create the unrolled CPU dispatcher