[#boost-urls-static_url-remove_port] = xref:boost/urls/static_url/remove_port.adoc[boost::urls::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#L398[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 * https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[] == Return Value `*this` == See Also xref:boost/urls/static_url/set_port.adoc[`set_port`]. [.small]#Created with https://www.mrdocs.com[MrDocs]#