add explicit operator!= for parray/ptext

This commit is contained in:
Martin Michelsen
2022-04-01 10:16:07 -07:00
parent c04ed9b6ce
commit 3370b5fad3
+15
View File
@@ -198,6 +198,9 @@ struct parray {
}
return true;
}
bool operator!=(const parray& s) const {
return !this->operator==(s);
}
void clear(ItemT v = 0) {
for (size_t x = 0; x < Count; x++) {
@@ -285,6 +288,18 @@ struct ptext : parray<CharT, Count> {
bool operator==(const ptext<OtherCharT, OtherCount>& s) const {
return text_streq_t(this->items, s.items);
}
template <typename OtherCharT>
bool operator!=(const OtherCharT* s) const {
return !this->operator==(s);
}
template <typename OtherCharT>
bool operator!=(const std::basic_string<OtherCharT>& s) const {
return !this->operator==(s);
}
template <typename OtherCharT, size_t OtherCount>
bool operator!=(const ptext<OtherCharT, OtherCount>& s) const {
return !this->operator==(s);
}
template <typename OtherCharT>
bool eq_n(const OtherCharT* s, size_t count) const {