From 5112ca31219fd745c8fdd2dd6f843079c155ac30 Mon Sep 17 00:00:00 2001 From: mikee47 Date: Sun, 9 Jun 2024 08:01:00 +0100 Subject: [PATCH] Templated != conflicts with ArduinoJson, be explicit --- src/include/FlashString/String.hpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/include/FlashString/String.hpp b/src/include/FlashString/String.hpp index ea40703..e9886d2 100644 --- a/src/include/FlashString/String.hpp +++ b/src/include/FlashString/String.hpp @@ -212,18 +212,28 @@ class String : public Object return equals(str, true); } + bool operator==(const char* cstr) const + { + return equals(cstr); + } + + bool operator!=(const char* cstr) const + { + return !equals(cstr); + } + /** @brief Check for equality with another String * @param str * @retval bool true if strings are identical */ bool equals(const String& str, bool ignoreCase = false) const; - template bool operator==(const T& str) const + bool operator==(const String& str) const { return equals(str); } - template bool operator!=(const T& str) const + bool operator!=(const String& str) const { return !equals(str); } @@ -234,6 +244,16 @@ class String : public Object bool equals(const WString& str, bool ignoreCase = false) const; + bool operator==(const WString& str) const + { + return equals(str); + } + + bool operator!=(const WString& str) const + { + return !equals(str); + } + /* Arduino Print support */ /**