MCPcopy Create free account
hub / github.com/boostorg/json / compare

Method compare

include/boost/json/string.hpp:1399–1403  ·  view source on GitHub ↗

Compare a string with the string. Let `comp` be `std::char_traits ::compare(data(), sv.data(), std::min(size(), sv.size())`. If `comp != 0`, then the result is `comp`. Otherwise, the result is `0` if `size() == sv.size()`, `-1` if `size() < sv.size()`, and `1` otherwise. @par Complexity Linear. @return The result of lexicographically

Source from the content-addressed store, hash-verified

1397 @param sv The `string_view` to compare.
1398 */
1399 int
1400 compare(string_view sv) const noexcept
1401 {
1402 return subview().compare(sv);
1403 }
1404
1405 //------------------------------------------------------
1406

Callers 3

usingStringsFunction · 0.45
runFunction · 0.45
testCompareMethod · 0.45

Calls

no outgoing calls

Tested by 1

runFunction · 0.36