:relfileprefix: ../../../
[#boost-urls-authority_view-has_port]

== xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/authority_view.adoc[pass:[authority_view]]::has_port


Return true if a port is present


=== Synopsis

Declared in header `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1098[boost/url/authority_view.hpp,window=blank_]>`

[source,cpp,subs="verbatim,macros,-callouts"]
----
bool
has_port() const noexcept;
----

=== Description


This function returns true if an
authority is present and contains a port.
[,cpp]
----
assert( url_view( "wss://www.example.com:443" ).has_port() );
----

=== Constant.

=== 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/authority_view/encoded_host_and_port.adoc[encoded_host_and_port]
,
xref:boost/urls/authority_view/port.adoc[port]
,
xref:boost/urls/authority_view/port_number.adoc[port_number]
.



