For stack, pop() is void, which means I need two lines of code whenever I want to get the top and pop:
pop()
auto top = s.top(); s.pop();
It would be convenient if I could just do:
auto top = s.pop();
Why is this so?
No one has answered this question yet.
See similar questions:
or similar: