A queue I created never pop front

In reply to cgales:

Thank you. Actually my question could be simplified as shown below.

We have a base class A and there is a member declared as “int x”.
and then class B is created, which is extending from A.
after that, we have two class, C and D. which both are extended from B.

so when we instance C and D, they have the “int x” as a member separately because they both extended from B, which extended from A.

my question is, how to implement if we need the “x” in class C and the “x” in class D are only one copy. ( I mean they are pointed to the same location, if the “x” in C changed, the “x” in D also changed)