[#boost-urls-url_view_base-has_port] = xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/url_view_base.adoc[url_view_base]::has_port :relfileprefix: ../../../ :mrdocs: Return true if a port is present == Synopsis Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1478[boost/url/url_view_base.hpp]>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- bool has_port() const noexcept; ---- == Description This function returns true if an authority is present and contains a port. === Example [,cpp] ---- assert( url_view( "wss://www.example.com:443" ).has_port() ); ---- === Complexity Constant. === 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)] Return true if a port is present This function returns true if an authority is present and contains a port. === Example [,cpp] ---- assert( url_view( "wss://www.example.com:443" ).has_port() ); ---- === Complexity Constant. === 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_view_base/encoded_host_and_port.adoc[encoded_host_and_port], xref:boost/urls/url_view_base/port.adoc[port], xref:boost/urls/url_view_base/port_number.adoc[port_number]. xref:boost/urls/url_view_base/encoded_host_and_port.adoc[encoded_host_and_port], xref:boost/urls/url_view_base/port.adoc[port], xref:boost/urls/url_view_base/port_number.adoc[port_number]. [.small]#Created with https://www.mrdocs.com[MrDocs]#