[#boost-urls-static_url-remove_port] = xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/static_url.adoc[static_url]::remove_port :relfileprefix: ../../../ :mrdocs: Remove the port == Synopsis Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L396[boost/url/static_url.hpp]>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:boost/urls/static_url.adoc[static_url]& remove_port() noexcept; ---- == Description If a port exists, it is removed. The rest of the authority is unchanged. === Example [,cpp] ---- assert( url( "http://www.example.com:80" ).remove_port().authority().buffer() == "www.example.com" ); ---- === Postconditions [,cpp] ---- this->has_port() == false && this->port_number() == 0 && this->port() == "" ---- === Complexity Linear in `this‐>size()`. === Exception Safety Throws nothing. === BNF [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] port = *DIGIT ---- === Specification * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[ 3.2.3. Port (rfc3986)] == See Also xref:boost/urls/url_base/set_port.adoc[set_port]. [.small]#Created with https://www.mrdocs.com[MrDocs]#