I discovered this recently as I tested an old idea I had to allow a dynamic language to use a C++-like vtable instead of an inline cache (like Objective-C or JavaScript does). It turns out modern CPUs predict an inline cache hit/miss result much better than always incurring the cost of the fetch in a vtable lookup.
You can implement it with templates and people do things like this often. In modern C++, it's even pretty easy to make this type of trick support `constexpr`.