Where do you check the value of previous ? If you do this inside this function, after the assignment, make sure the assembly is disabled, and then try again.
On the other hand, if you look at the previous outside the scope of this function, it will never be changed. When you call search() , a copy of the previous pointer is loaded onto the stack, and you modify that copy. Modification disappears after the function exits. To save the changes, do something like this:
inline int search(QueueEntry<T> *current,QueueEntry<T> **previous, unsigned long long t) { ... *previous = current; ... }
Now the call to search() will have to pass the address to the pointer instead of the value.
Or you can pass the link, and the rest of your code will remain the same.
inline int search(QueueEntry<T> *current,QueueEntry<T> *&previous, unsigned long long t)
source share