From 5799a4ee5b8bf0f97c96e68e0f204fbfdec0c302 Mon Sep 17 00:00:00 2001 From: hogliux Date: Tue, 12 Jun 2018 15:54:48 +0100 Subject: [PATCH] MSVC: Added a workaround for a compiler bug --- modules/juce_core/containers/juce_Array.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/juce_core/containers/juce_Array.h b/modules/juce_core/containers/juce_Array.h index e0cdb9057d..f85a028ec7 100644 --- a/modules/juce_core/containers/juce_Array.h +++ b/modules/juce_core/containers/juce_Array.h @@ -274,7 +274,8 @@ public: return data.elements[index]; } - return {}; + // We can't default aggregate initialise here "{}" due to a VS2017 compiler bug + return ElementType(); } /** Returns one of the elements in the array, without checking the index passed in. @@ -322,7 +323,7 @@ public: return data.elements[0]; } - return {}; + return ElementType(); } /** Returns the last element in the array, or a default value if the array is empty. @@ -339,7 +340,7 @@ public: return data.elements[numUsed - 1]; } - return {}; + return ElementType(); } /** Returns a pointer to the actual array data. @@ -890,7 +891,7 @@ public: return removed; } - return {}; + return ElementType(); } /** Removes an element from the array.