为什么 C++ 中成员函数指针是 16 字节?(二)
r(obj, &C::foo);
? ? call_by_ptr(obj, &C::bar);
}
上面的程序输出如下:
?
------------------------------
Object ptr: ? ?0x7fff535dfb28
Function ptr: ?0x10c620cac
Pointer adj: ? 0
A's this: ? ?0x7fff535dfb28
------------------------------
Object ptr: ? ?0x7fff535dfb28
Function ptr: ?0x10c620cfe
Pointer adj: ? 0x20
B's this: ? ?0x7fff535dfb48
希望本文能使问题变得更明确一点。
?