[#boost-urls-url_view_base-has_authority] = xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/url_view_base.adoc[url_view_base]::has_authority :relfileprefix: ../../../ :mrdocs: Return true if an authority is present == Synopsis Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L511[boost/url/url_view_base.hpp]>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- bool has_authority() const noexcept; ---- == Description This function returns true if the url contains an authority. The presence of an authority is denoted by a double slash ("//") at the beginning or after the scheme. == Example [,cpp] ---- assert( url_view( "http://www.example.com/index.htm" ).has_authority() ); ---- == Complexity Constant. == Exception Safety Throws nothing. == BNF [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] absolute-URI = scheme ":" hier-part [ "?" query ] URI-reference = URI / relative-ref relative-ref = relative-part [ "?" query ] [ "#" fragment ] hier-part = "//" authority path-abempty ; (more...) relative-part = "//" authority path-abempty ; (more...) ---- == Specification * https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[] == Return Value `true` if the url contains an authority. == See Also xref:boost/urls/url_view_base/authority.adoc[`authority`], xref:boost/urls/url_view_base/encoded_authority.adoc[`encoded_authority`]. [.small]#Created with https://www.mrdocs.com[MrDocs]#