Skip to content

Commit 5112ca3

Browse files
author
mikee47
committed
Templated != conflicts with ArduinoJson, be explicit
1 parent bf8b3dc commit 5112ca3

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

src/include/FlashString/String.hpp

+22-2
Original file line numberDiff line numberDiff line change
@@ -212,18 +212,28 @@ class String : public Object<String, char>
212212
return equals(str, true);
213213
}
214214

215+
bool operator==(const char* cstr) const
216+
{
217+
return equals(cstr);
218+
}
219+
220+
bool operator!=(const char* cstr) const
221+
{
222+
return !equals(cstr);
223+
}
224+
215225
/** @brief Check for equality with another String
216226
* @param str
217227
* @retval bool true if strings are identical
218228
*/
219229
bool equals(const String& str, bool ignoreCase = false) const;
220230

221-
template <typename T> bool operator==(const T& str) const
231+
bool operator==(const String& str) const
222232
{
223233
return equals(str);
224234
}
225235

226-
template <typename T> bool operator!=(const T& str) const
236+
bool operator!=(const String& str) const
227237
{
228238
return !equals(str);
229239
}
@@ -234,6 +244,16 @@ class String : public Object<String, char>
234244

235245
bool equals(const WString& str, bool ignoreCase = false) const;
236246

247+
bool operator==(const WString& str) const
248+
{
249+
return equals(str);
250+
}
251+
252+
bool operator!=(const WString& str) const
253+
{
254+
return !equals(str);
255+
}
256+
237257
/* Arduino Print support */
238258

239259
/**

0 commit comments

Comments
 (0)