[#boost-urls-url_view_base-has_password] = xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/url_view_base.adoc[url_view_base]::has_password :relfileprefix: ../../../ :mrdocs: Return true if a password is present == Synopsis Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L644[boost/url/url_view_base.hpp]>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- bool has_password() const noexcept; ---- == Description This function returns true if the userinfo is present and contains a password. === Example [,cpp] ---- assert( url_view( "http://jane%2Ddoe:pass@example.com" ).has_password() ); ---- === Complexity Constant. === Exception Safety Throws nothing. === BNF [,cpp] ---- userinfo = user [ ":" [ password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- === Specification * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)] Return true if a password is present This function returns true if the userinfo is present and contains a password. === Example [,cpp] ---- assert( url_view( "http://jane%2Ddoe:pass@example.com" ).has_password() ); ---- === Complexity Constant. === Exception Safety Throws nothing. === BNF [,cpp] ---- userinfo = user [ ":" [ password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- === Specification * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)] == See Also xref:boost/urls/url_view_base/has_userinfo.adoc[has_userinfo], xref:boost/urls/url_view_base/encoded_password.adoc[encoded_password], xref:boost/urls/url_view_base/encoded_user.adoc[encoded_user], xref:boost/urls/url_view_base/encoded_userinfo.adoc[encoded_userinfo], xref:boost/urls/url_view_base/password.adoc[password], xref:boost/urls/url_view_base/user.adoc[user], xref:boost/urls/url_view_base/userinfo.adoc[userinfo]. xref:boost/urls/url_view_base/has_userinfo.adoc[has_userinfo], xref:boost/urls/url_view_base/encoded_password.adoc[encoded_password], xref:boost/urls/url_view_base/encoded_user.adoc[encoded_user], xref:boost/urls/url_view_base/encoded_userinfo.adoc[encoded_userinfo], xref:boost/urls/url_view_base/password.adoc[password], xref:boost/urls/url_view_base/user.adoc[user], xref:boost/urls/url_view_base/userinfo.adoc[userinfo]. [.small]#Created with https://www.mrdocs.com[MrDocs]#