[#bsl-stack-05-top-06] = xref:bsl.adoc[bsl]::xref:bsl/stack-05.adoc[stack]::top :relfileprefix: ../../ :mrdocs: `top` overloads == Synopses Declared in `<bslstl_stack.h>` Return a reference to the element at the top of this stack. The behavior is undefined if this stack is empty. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- CONTAINER::reference xref:bsl/stack-05/top-034.adoc[top](); ---- [.small]#xref:bsl/stack-05/top-034.adoc[_» more..._]# Return a reference providing non‐modifiable access to the element at the top of this stack. The behavior is undefined if the stack is empty. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- CONTAINER::const_reference xref:bsl/stack-05/top-035.adoc[top]() const; ---- [.small]#xref:bsl/stack-05/top-035.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#