mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
HeapBlock: Disable size-based constructor for non-integral arguments
This commit is contained in:
parent
ef0b1ec1ef
commit
e02a09da0c
1 changed files with 2 additions and 2 deletions
|
|
@ -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 <typename SizeType>
|
||||
template <typename SizeType, std::enable_if_t<std::is_integral<SizeType>::value, int> = 0>
|
||||
explicit HeapBlock (SizeType numElements)
|
||||
: data (static_cast<ElementType*> (std::malloc (static_cast<size_t> (numElements) * sizeof (ElementType))))
|
||||
{
|
||||
|
|
@ -119,7 +119,7 @@ public:
|
|||
The initialiseToZero parameter determines whether the new memory should be cleared,
|
||||
or left uninitialised.
|
||||
*/
|
||||
template <typename SizeType>
|
||||
template <typename SizeType, std::enable_if_t<std::is_integral<SizeType>::value, int> = 0>
|
||||
HeapBlock (SizeType numElements, bool initialiseToZero)
|
||||
: data (static_cast<ElementType*> (initialiseToZero
|
||||
? std::calloc (static_cast<size_t> (numElements), sizeof (ElementType))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue