diff --git a/src/StringN.h b/src/StringN.h index 66229e3..c7e5144 100644 --- a/src/StringN.h +++ b/src/StringN.h @@ -76,6 +76,17 @@ class StringN { return add(val); } + template + bool operator==(const StringN& other) const { + if (_len != other._len) return false; + return memcmp(_buf, other._buf, _len) == 0; + } + + template + bool operator!=(const StringN& other) const { + return !(*this == other); + } + // ============== StringN ============== template StringN& add(const StringN& str) {