Add Span equality (== and !=) operators.
Exchange duplicate equality iteration implementations across `Vector` and `String` with the `Span` version, for a speed boost.
This commit is contained in:
@ -61,6 +61,10 @@ TEST_CASE("[Span] Constexpr Validators") {
|
||||
static_assert(span_string[0] == U'1');
|
||||
static_assert(span_string[span_string.size() - 1] == U'5');
|
||||
|
||||
CHECK_EQ(span_string, span_string); // Same identity / ptr.
|
||||
CHECK_EQ(span_string, Span(U"1223456", 6)); // Different ptr.
|
||||
CHECK_EQ(span_string, Span("122345").reinterpret<uint8_t>()); // Different type.
|
||||
|
||||
int idx = 0;
|
||||
for (const char32_t &chr : span_string) {
|
||||
CHECK_EQ(chr, span_string[idx++]);
|
||||
|
||||
Reference in New Issue
Block a user