C++ implementation for a generic template based linked list