Skip to content

Commit

Permalink
Disambiguate PString (in)equality operators
Browse files Browse the repository at this point in the history
Otherwise when compiling ptlib consumer code with C++ 20
compilation fails.
  • Loading branch information
gjasny committed Jan 19, 2022
1 parent e34ada8 commit 69d261b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/ptlib/contain.inl
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,15 @@ PINLINE PString & PString::operator&=(const PString & str)
PINLINE bool PString::operator==(const PObject & obj) const
{ return PObject::operator==(obj); }

PINLINE bool PString::operator==(const PString & obj) const
{ return PObject::operator==(obj); }

PINLINE bool PString::operator!=(const PObject & obj) const
{ return PObject::operator!=(obj); }

PINLINE bool PString::operator!=(const PString & obj) const
{ return PObject::operator!=(obj); }

PINLINE bool PString::operator<(const PObject & obj) const
{ return PObject::operator<(obj); }

Expand Down
22 changes: 22 additions & 0 deletions include/ptlib/pstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,17 @@ class PString : public PCharArray
const PObject & str ///< PString object to compare against.
) const;

/**Compare two strings using the <code>PObject::Compare()</code> function. This
is identical to the <code>PObject</code> class function but is necessary due
to other overloaded versions.
@return
true if equal.
*/
bool operator==(
const PString & str ///< PString object to compare against.
) const;

/**Compare two strings using the <code>PObject::Compare()</code> function. This
is identical to the <code>PObject</code> class function but is necessary due
to other overloaded versions.
Expand All @@ -839,6 +850,17 @@ class PString : public PCharArray
const PObject & str ///< PString object to compare against.
) const;

/**Compare two strings using the <code>PObject::Compare()</code> function. This
is identical to the <code>PObject</code> class function but is necessary due
to other overloaded versions.
@return
true if not equal.
*/
bool operator!=(
const PString & str ///< PString object to compare against.
) const;

/**Compare two strings using the <code>PObject::Compare()</code> function. This
is identical to the <code>PObject</code> class function but is necessary due
to other overloaded versions.
Expand Down

0 comments on commit 69d261b

Please sign in to comment.