Moved operator== to be hidden friend instead of put directly in global namespace

Moved GetTypeHash function to be hidden friend instead of put directly in global namespace.

Note that the function/operator needs to be fully inlined in the type or placed in the cpp. If the function is added as friend but then implemented outside the type then hidden friend optimization won't work.

This should improve compile time somewhat according to msvc devs.

#rb Steve.Robb
#preflight 6360b7052b5338aceb26471b

[CL 22889837 by henrik karlsson in ue5-main branch]
This commit is contained in:
henrik karlsson
2022-11-01 15:50:27 -04:00
parent 891737c14e
commit 4a36cfe8ff
95 changed files with 2126 additions and 2202 deletions

View File

@@ -789,12 +789,12 @@ struct FTargetPlatform
return Ordinal == Other.Ordinal;
}
friend inline uint32 GetTypeHash(const FTargetPlatform& Key) { return Key.GetOrdinal(); }
private:
uint32 Ordinal = 0;
};
inline uint32 GetTypeHash(const FTargetPlatform& Key) { return Key.GetOrdinal(); }
/**
* Target platform set implementation using bitmask for compactness
*/