While going through this C++ FAQ https://isocpp.org/wiki/faq/mixing-c-and-cpp#cpp-objs-passed-to-c I encountered the statement
Most C++ compilers use a binary object layout that causes this conversion to happen with multiple inheritance and/or virtual inheritance.
I could not understand the meaning and application of it. As per the C++ FAQ this object layout mechanism helps C++ compiler in the below mentioned check
In C++ it is easy to check if a Derived* called dp points to the same object as is pointed to by a Base* called bp: just say if (dp == bp) .... The C++ compiler automatically converts both pointers to the same type, in this case to Base*, then compares them. Depending on the C++ compiler’s implementation details, this conversion sometimes changes the bits of a pointer’s value.
Could any one help to understand the binary object layout of any popular C++ compilers and what possible changes and the corresponding mechanism for changes in the bits of a pointer’s value. and How it helps in comparing the pointers of Base/Derived classes.
Edit : Please explain why the below is also a valid statement.
NOTE: you must be especially careful when converting both to void* since that conversion will not allow either the C or C++ compiler to do the proper pointer adjustments! The comparison (x == y) might be false even if (b == d) is true: