[#boost-urls-segments_base-back] = xref:boost/urls/segments_base/back.adoc[boost::urls::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#L282[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. == Return Value The last segment. [.small]#Created with https://www.mrdocs.com[MrDocs]#