Basic stack implemented in C++