:relfileprefix: ../../../ [#boost-urls-url_view_base-has_fragment] == xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/url_view_base.adoc[pass:[url_view_base]]::has_fragment Return true if a fragment is present === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool has_fragment() const noexcept; ---- === Description This function returns true if the url contains a fragment. An empty fragment is distinct from no fragment. [,cpp] ---- assert( url_view( "http://www.example.com/index.htm#anchor" ).has_fragment() ); ---- === Constant. === Throws nothing. [,cpp] ---- URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] relative-ref = relative-part [ "?" query ] [ "#" fragment ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3.5. Fragment (rfc3986)] === See Also xref:boost/urls/url_view_base/encoded_fragment.adoc[encoded_fragment] , xref:boost/urls/url_view_base/fragment.adoc[fragment] .