From 845bcdf14c0beda51d6bfd0c9db062c287e35d8b Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Fri, 16 Jan 2015 19:13:51 -0500 Subject: [PATCH] - Attempt to disable all comparison operators on FString since unless we decide otherwise, it's a programming error to use them (caused implicit conversion to const char* and then the built in comparision was called). --- src/zstring.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/zstring.h b/src/zstring.h index 0104020fa..82c38142c 100644 --- a/src/zstring.h +++ b/src/zstring.h @@ -296,6 +296,16 @@ protected: static FNullStringData NullString; friend struct FStringData; + +private: + // Prevent these from being called as current practices are to use Compare. + // Without this FStrings will be accidentally compared against char* ptrs. + bool operator == (const FString &illegal) const; + bool operator != (const FString &illegal) const; + bool operator < (const FString &illegal) const; + bool operator > (const FString &illegal) const; + bool operator <= (const FString &illegal) const; + bool operator >= (const FString &illegal) const; }; namespace StringFormat