fix template unqualified lookup build errors on clang

This commit is contained in:
Mohammad S. Babaei 2018-03-05 17:03:38 +03:30
parent 2e994ac124
commit ab103ac65f
No known key found for this signature in database
GPG Key ID: 2AF604DEF57A2098
2 changed files with 16 additions and 13 deletions

View File

@ -10,6 +10,9 @@
namespace Utilities
{
template<typename T>
FORCEINLINE const FWorldContext* GetWorldContext(const T* Obj);
FORCEINLINE const FWorldContext* GetWorldContext(const UGameInstance& GameInstance)
{
return GameInstance.GetWorldContext();
@ -21,12 +24,6 @@ namespace Utilities
return Obj.IsValid() ? GetWorldContext(*Obj.Get()) : nullptr;
}
template<typename T>
FORCEINLINE const FWorldContext* GetWorldContext(const T* Obj)
{
return Obj ? GetWorldContext(*Obj) : nullptr;
}
FORCEINLINE const FWorldContext* GetWorldContext(const UGameViewportClient& GameViewportClient)
{
return GetWorldContext(GameViewportClient.GetGameInstance());
@ -37,5 +34,11 @@ namespace Utilities
return GetWorldContext(World.GetGameInstance());
}
template<typename T>
FORCEINLINE const FWorldContext* GetWorldContext(const T* Obj)
{
return Obj ? GetWorldContext(*Obj) : nullptr;
}
const FWorldContext* GetWorldContextFromNetMode(ENetMode NetMode);
}

View File

@ -22,13 +22,6 @@ namespace Utilities
// Editor context index.
static constexpr int32 EDITOR_CONTEXT_INDEX = 0;
template<typename T>
FORCEINLINE int32 GetWorldContextIndex(const T& Obj)
{
const FWorldContext* WorldContext = GetWorldContext(Obj);
return WorldContext ? GetWorldContextIndex(*WorldContext) : INVALID_CONTEXT_INDEX;
}
FORCEINLINE int32 GetWorldContextIndex(const FWorldContext& WorldContext)
{
// In standalone game (WorldType = Game) we have only one context with index 0 (see GAME_CONTEXT_INDEX).
@ -51,6 +44,13 @@ namespace Utilities
}
}
template<typename T>
FORCEINLINE int32 GetWorldContextIndex(const T& Obj)
{
const FWorldContext* WorldContext = GetWorldContext(Obj);
return WorldContext ? GetWorldContextIndex(*WorldContext) : INVALID_CONTEXT_INDEX;
}
int32 GetWorldContextIndex(const UWorld& World)
{
return (World.WorldType == EWorldType::Editor) ? EDITOR_CONTEXT_INDEX : GetWorldContextIndex(World.GetGameInstance());