I would expect pFirst
to always point to the same place in the address. However it looks like pFirst
moves along with pCurrent
even though the function only entered the Else statement once.
Note:code is creating a linked list .
void Push(T data) {
++_size;
Data d = Data(data);
if (_pCurrent != nullptr) _pCurrent->SetNext(&d);
else _pFirst = &d;
_pCurrent = &d;
}