我刚看了这个答案虚拟功能和vtable是如何实现的?.响应的作者使用以下表达式:
std::swap(*(void **)x, *(void **)y);
// Now x is a C, and y is a B! Hope they used the same layout of members!
Run Code Online (Sandbox Code Playgroud)
有人可以解释它是如何工作的?为什么和(void **)后面的意思是什么operator*?
c++ ×1