MCPcopy Create free account
hub / github.com/FastLED/FastLED / lexicographical_compare

Function lexicographical_compare

src/fl/stl/algorithm.h:146–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144// Returns true if the first range is lexicographically less than the second
145template <typename Iterator1, typename Iterator2>
146bool lexicographical_compare(Iterator1 first1, Iterator1 last1, Iterator2 first2, Iterator2 last2) FL_NOEXCEPT {
147 while (first1 != last1 && first2 != last2) {
148 if (*first1 < *first2) {
149 return true;
150 }
151 if (*first2 < *first1) {
152 return false;
153 }
154 ++first1;
155 ++first2;
156 }
157 // If we've exhausted first1 but not first2, first1 is less
158 // If we've exhausted both, they're equal (return false)
159 // If we've exhausted first2 but not first1, first2 is less (return false)
160 return (first1 == last1) && (first2 != last2);
161}
162
163// Lexicographical comparison with custom comparator
164template <typename Iterator1, typename Iterator2, typename Compare>

Callers 5

operator<Function · 0.85
operator<Function · 0.85
operator<Method · 0.85
operator<Method · 0.85
FL_TEST_FILEFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected