You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The String class has an incomplete set of relational operators with
`const char*`. The 6 operators `==`,`!=`,`<`,`>`,`<=`,`>=` must be
defined between String and String, but also between String and `const
char*`.
The motivation is to treat left and right operands symmetrically. str
== "hello" works, but swapping arguments to "hello" == str doesn't,
which is a potential user surprise.
As String is implicitly convertible from `const char*`, but this incurs
a "strdup". So it also makes sense to provide relational operators
directly with const char* to avoid the expensive promotion of const
char* to temporary String, just to do a string value comparison.
Resolves: #7139
0 commit comments