4 ms·
> Well, on second thought, is there any reason why an int function ptr should be any different from an int ptr? I don't know any other example, but in Itanium,
by yongjik 6y ago
> Well, on second thought, is there any reason why an int function ptr should be any different from an int ptr?
I don't know any other example, but in Itanium, a function pointer is not just an address but an (address+address) pair where the second address is a sort of a base pointer for data segment:
https://stackoverflow.com/a/18908021 https://stackoverflow.com/a/18908021
- account4mypc 6y agoI don't think this is true except maybe on ancient architectures. function ptrs are usually just addresses (64 bits on most modern computers). virtual member function ptrs can have an extra bit of info to resolve the this ptr at runtime. so usually (but not always), sizeof(int ptr) == sizeof(func ptr)