
Thunk is a very useful technology. I talk about three typical uses of thunk in this article: 1. turning callbacks into member functions of classes. 2. providing an interface proxy. 3. supporting virtual functions under multiple inheritance in c++. Before we start, let's have a general idea of what thunk is. Thunk is generally a piece of machine code that intercepts a client call and modifies the call stack before jumping to the real implementation of the client call.
|