From e02a09da0c7cdbe8f4f23f29abebd314e682c306 Mon Sep 17 00:00:00 2001 From: reuk Date: Wed, 18 Aug 2021 17:00:36 +0100 Subject: [PATCH] HeapBlock: Disable size-based constructor for non-integral arguments --- modules/juce_core/memory/juce_HeapBlock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/juce_core/memory/juce_HeapBlock.h b/modules/juce_core/memory/juce_HeapBlock.h index 9092529d7a..61a1493b32 100644 --- a/modules/juce_core/memory/juce_HeapBlock.h +++ b/modules/juce_core/memory/juce_HeapBlock.h @@ -107,7 +107,7 @@ public: If you want an array of zero values, you can use the calloc() method or the other constructor that takes an InitialisationState parameter. */ - template + template ::value, int> = 0> explicit HeapBlock (SizeType numElements) : data (static_cast (std::malloc (static_cast (numElements) * sizeof (ElementType)))) { @@ -119,7 +119,7 @@ public: The initialiseToZero parameter determines whether the new memory should be cleared, or left uninitialised. */ - template + template ::value, int> = 0> HeapBlock (SizeType numElements, bool initialiseToZero) : data (static_cast (initialiseToZero ? std::calloc (static_cast (numElements), sizeof (ElementType))