C++ Double linked list implementation