From ab103ac65fd74ea57bcd700ef9276eed6b2ca6b7 Mon Sep 17 00:00:00 2001 From: "Mohammad S. Babaei" Date: Mon, 5 Mar 2018 17:03:38 +0330 Subject: [PATCH] fix template unqualified lookup build errors on clang --- Source/ImGui/Private/Utilities/WorldContext.h | 15 +++++++++------ .../ImGui/Private/Utilities/WorldContextIndex.h | 14 +++++++------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Source/ImGui/Private/Utilities/WorldContext.h b/Source/ImGui/Private/Utilities/WorldContext.h index 6a75e2c..790383e 100644 --- a/Source/ImGui/Private/Utilities/WorldContext.h +++ b/Source/ImGui/Private/Utilities/WorldContext.h @@ -10,6 +10,9 @@ namespace Utilities { + template + 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 - 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 + FORCEINLINE const FWorldContext* GetWorldContext(const T* Obj) + { + return Obj ? GetWorldContext(*Obj) : nullptr; + } + const FWorldContext* GetWorldContextFromNetMode(ENetMode NetMode); } diff --git a/Source/ImGui/Private/Utilities/WorldContextIndex.h b/Source/ImGui/Private/Utilities/WorldContextIndex.h index 011ef8e..7ee26c7 100644 --- a/Source/ImGui/Private/Utilities/WorldContextIndex.h +++ b/Source/ImGui/Private/Utilities/WorldContextIndex.h @@ -22,13 +22,6 @@ namespace Utilities // Editor context index. static constexpr int32 EDITOR_CONTEXT_INDEX = 0; - template - 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 + 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());