|
stack::toppublic member function
value_type& top ( ); const value_type& top ( ) const; Access next element Returns a reference to the next element in the stack. Since stacks are last-in first-out containers this is also the last element pushed into the stack.This member function effectively calls the member function back of the underlying container object. ParametersnoneReturn valueA reference to the next element in the stack.Member type value_type is defined to the type of value contained by the underlying container, which shall be the same as the first template parameter (T). Example
Output:
ComplexityConstant.See also
|