From b2b1685ca6c2ffda2e84f3547eb68c1c4a11ac09 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 22 Apr 2021 17:34:25 +0100 Subject: [PATCH] Added MemoryBlock::isEmpty() --- modules/juce_core/memory/juce_MemoryBlock.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/juce_core/memory/juce_MemoryBlock.h b/modules/juce_core/memory/juce_MemoryBlock.h index c5beedee75..133bf0f285 100644 --- a/modules/juce_core/memory/juce_MemoryBlock.h +++ b/modules/juce_core/memory/juce_MemoryBlock.h @@ -120,6 +120,9 @@ public: const char* end() const noexcept { return begin() + getSize(); } //============================================================================== + /** Returns true if the memory block has zero size. */ + bool isEmpty() const noexcept { return getSize() == 0; } + /** Returns the block's current allocated size, in bytes. */ size_t getSize() const noexcept { return size; }