:relfileprefix: ../../../ [#boost-urls-url_view_base-compare] = xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/url_view_base.adoc[pass:[url_view_base]]::compare Return the result of comparing this with another url == Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- int compare(xref:boost/urls/url_view_base.adoc[url_view_base] const& other) const noexcept; ---- == Description This function compares two URLs according to Syntax-Based comparison algorithm. === Complexity Linear in `min( u0.size(), u1.size() )` === Exception Safety Throws nothing. === Specification * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] == Return Value -1 if `*this < other`, 0 if `this == other`, and 1 if `this > other`.