MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / compare

Method compare

extlibs/fmt/include/fmt/core.h:410–416  ·  view source on GitHub ↗

Lexicographically compare this string reference to other.

Source from the content-addressed store, hash-verified

408
409 // Lexicographically compare this string reference to other.
410 int compare(basic_string_view other) const {
411 size_t str_size = size_ < other.size_ ? size_ : other.size_;
412 int result = std::char_traits<Char>::compare(data_, other.data_, str_size);
413 if (result == 0)
414 result = size_ == other.size_ ? 0 : (size_ < other.size_ ? -1 : 1);
415 return result;
416 }
417
418 friend bool operator==(basic_string_view lhs, basic_string_view rhs) {
419 return lhs.compare(rhs) == 0;

Callers 6

operator==Method · 0.45
operator!=Method · 0.45
operator<Method · 0.45
operator<=Method · 0.45
operator>Method · 0.45
operator>=Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected