:relfileprefix: ../../../
[#boost-urls-decode_view-compare-02]

= xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/decode_view.adoc[pass:[decode_view]]::compare


Return the result of comparing to another string


== Synopsis

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

[source,cpp,subs="verbatim,macros,-callouts"]
----
int
compare(core::string_view other) const noexcept;
----

== Description


The length of the sequences to compare is the smaller of
`size()` and `other.size()`.

The function compares the two strings as if by calling
`char_traits&lt;char&gt;::compare(to_string().data(), v.data(), rlen)`.
This means the comparison is performed with
percent-decoding applied to the current string.




== Return Value


Negative value if this string is less than the other
character sequence, zero if the both character sequences are
equal, positive value if this string is greater than the other
character sequence



== Parameters

|===
| Name | Description 

| *other*
| 
string to compare

|===




