Implementation of a singly linked list, C++