C++ Template to implement a Stack