40template <
class ElementType,
class TypeOfCriticalSectionToUse>
52 : elements (std::move (
other.elements)),
53 numAllocated (
other.numAllocated)
59 elements = std::move (
other.elements);
60 numAllocated =
other.numAllocated;
98 jassert (numAllocated <= 0 || elements !=
nullptr);
114 std::swap (numAllocated,
other.numAllocated);
119 int numAllocated = 0;
Implements some basic array storage allocation functions.
void shrinkToNoMoreThan(int maxNumElements)
Minimises the amount of storage allocated so that it's no more than the given number of elements.
ArrayAllocationBase()=default
Creates an empty array.
~ArrayAllocationBase()=default
Destructor.
void ensureAllocatedSize(int minNumElements)
Increases the amount of storage allocated if it is less than a given amount.
void setAllocatedSize(int numElements)
Changes the amount of storage allocated.
void swapWith(ArrayAllocationBase &other) noexcept
Swap the contents of two objects.
Holds a resizable array of primitive or copy-by-value objects.
void swapWith(OtherArrayType &otherArray) noexcept
This swaps the contents of this array with those of another array.