MCPcopy Create free account
hub / github.com/andreasfertig/programming-with-cpp20 / Compare

Method Compare

06.06-orderingComparisonString0/main.cpp:65–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63};
64
65Ordering String::Compare(const String& a, const String& b)
66{
67 if(a.mLen == b.mLen &&
68 std::equal(a.begin(), a.end(), b.begin(), b.end())) {
69 return Ordering::Equal;
70 }
71
72 if(std::lexicographical_compare(
73 a.begin(), a.end(), b.begin(), b.end())) {
74 return Ordering::LessThan;
75 }
76
77 return Ordering::GreaterThan;
78}
79
80#define CMP_PRINT(op, expected) \
81 { \

Callers

nothing calls this directly

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected