[#boost-urls-segments_base-back] = xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/segments_base.adoc[segments_base]::back :relfileprefix: ../../../ :mrdocs: Return the last segment == Synopsis Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L292[boost/url/segments_base.hpp]>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::string back() const noexcept; ---- == Description === Preconditions [,cpp] ---- this->empty() == false ---- === Example [,cpp] ---- assert( url_view( "/path/to/file.txt" ).segments().back() == "file.txt" ); ---- === Preconditions [,cpp] ---- this->empty() == false ---- === Effects [,cpp] ---- return *--end(); ---- === Complexity Linear in `this‐>back().size()`. === Exception Safety Calls to allocate may throw. [.small]#Created with https://www.mrdocs.com[MrDocs]#