Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/StringN.h
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,17 @@ class StringN {
return add(val);
}

template <uint16_t N>
bool operator==(const StringN<N>& other) const {
if (_len != other._len) return false;
return memcmp(_buf, other._buf, _len) == 0;
}

template <uint16_t N>
bool operator!=(const StringN<N>& other) const {
return !(*this == other);
}

// ============== StringN ==============
template <uint16_t N>
StringN& add(const StringN<N>& str) {
Expand Down