Skip to content

Commit

Permalink
Templated != conflicts with ArduinoJson, be explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
mikee47 committed Jun 9, 2024
1 parent 0799f36 commit 5aa4697
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/include/FlashString/String.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,28 @@ class String : public Object<String, char>
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 <typename T> bool operator==(const T& str) const
bool operator==(const String& str) const
{
return equals(str);
}

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

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 */

/**
Expand Down

0 comments on commit 5aa4697

Please sign in to comment.