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

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


Return true if a userinfo is present


== Synopsis

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

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

== Description


This function returns true if this
contains a userinfo.

=== Example
[,cpp]
----
assert( url_view( "http://jane%2Ddoe:pass@example.com" ).has_userinfo() );
----

=== Complexity

Constant.

=== Exception Safety

Throws nothing.

=== BNF
[,cpp]
----
userinfo    = user [ ":" [ password ] ]

authority   = [ userinfo "@" ] host [ ":" port ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)]








== See Also


xref:boost/urls/authority_view/has_password.adoc[has_password]
,
xref:boost/urls/authority_view/encoded_password.adoc[encoded_password]
,
xref:boost/urls/authority_view/encoded_user.adoc[encoded_user]
,
xref:boost/urls/authority_view/encoded_userinfo.adoc[encoded_userinfo]
,
xref:boost/urls/authority_view/password.adoc[password]
,
xref:boost/urls/authority_view/user.adoc[user]
,
xref:boost/urls/authority_view/userinfo.adoc[userinfo]
.



