If you don't need the element anymore after popping it just
// use element with
container.top();
// remove it
container.pop();
Otherwise make a copy of the object:
Element e = container.top();
container.pop(); // remove it
// feel free to use e, you made a copy of it
If you need to really delete
it manually then you are not using any kind of smart pointer, which moves the problem to another topic.