std::stack::top

From Cppreference

Jump to: navigation, search
reference top();

const_reference top() const;

Returns reference to the top element in the stack. This is the most recently pushed element. This element will be removed on a call to pop(). Effectively calls c.back().

Contents

[edit] Parameters

(none)

[edit] Return value

reference to the last element

[edit] Complexity

Constant

[edit] See also

push
inserts element at the top
(public member function)
pop
removes the first element
(public member function)