Return true if a fragment is present

Synopsis

Declared in header </boost/url/url_view_base.hpp#L2090[boost/url/url_view_base.hpp,window=blank_]>

bool
has_fragment() const noexcept;

Description

This function returns true if the url contains a fragment. An empty fragment is distinct from no fragment.

Example

assert( url_view( "http://www.example.com/index.htm#anchor" ).has_fragment() );

Complexity

Constant.

Exception Safety

Throws nothing.

BNF

URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

relative-ref  = relative-part [ "?" query ] [ "#" fragment ]

Specification

Return Value

  • bool