D
Dave
In std::stack<>, why are both const and non-const versions of top()
necessary? Wouldn't only the const version suffice? This could be called
on either a const or non-const stack object and, in either case, this method
does indeed not modify the stack it is a part of...
necessary? Wouldn't only the const version suffice? This could be called
on either a const or non-const stack object and, in either case, this method
does indeed not modify the stack it is a part of...