c++/stack: Demo const member function