#pragma once template struct List { struct Container { T* t; Container* next; Container(T* t) : t(t) {} }; Container* first; Container* last; void add(T* t) { Container* c = new Container{t}; first == nullptr ? first = c : last->next = c; last = c; } };