:relfileprefix: ../../../ [#boost-urls-static_url-remove_port] == xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/static_url.adoc[pass:[static_url]]::remove_port Remove the port === Synopsis Declared in header `` [source,cpp,subs="verbatim,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. [,cpp] ---- assert( url( "http://www.example.com:80" ).remove_port().authority().buffer() == "www.example.com" ); ---- [,cpp] ---- this->has_port() == false && this->port_number() == 0 && this->port() == "" ---- === Linear in `this->size()`. === Throws nothing. [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] port = *DIGIT ---- * 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] .