Your class ReviewBuffer
uses multiple inheritance:
class ReviewBuffer : public StreamConsumer_Base, public Mutex
{
...
};
The internal layout of the class (probably*) looks like this:
Offset 0 class StreamConsumer_Base
... contents of that class (12 bytes including alignment: 0x1f83e54 - 0x1f83e48)
Offset 12 class Mutex
... contents of that class (unknown size)
(*) probably because nothing in the standard mandates this. This is just the usual way compilers implement it.
When you initially print thePointer
, it points to the ReviewBuffer
object ie. offset 0 of the class. But when you pass it to your function, the pointer automatically gets adjusted by the compiler to point to the Mutex
part of ReviewBuffer
. Since that Mutex
part is at offset 12, the value of the pointer cannot be the same (think about it: if it was the same, it would not point to a Mutex
but to either a ReviewBuffer
or a StreamConsumer_Base
).