[#bsl-stack-05-top-035] = xref:bsl.adoc[bsl]::xref:bsl/stack-05.adoc[stack]::top :relfileprefix: ../../ :mrdocs: 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. == Synopsis Declared in `<bslstl_stack.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- CONTAINER::const_reference top() const; ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#