It will only consider member variables.
In addition, non-virtual member functions do not contribute to the size of the struct , since they do not require runtime support.
To understand why this is so, imagine that from the point of view of the compiler, this code is very similar to this pseudocode:
struct MyAdd { int c; int d; }; int MyAdd_AddInt(MyAdd* this) { ... }
Sergey K.
source share