template<typename ElementType, bool throwOnFailure = false>
class juce::CopyableHeapBlock< ElementType, throwOnFailure >
Wraps a HeapBlock, but additionally provides a copy constructor and remembers its size.
This class is not intended for use as a general-purpose container - in most cases, a std::vector or juce::Array is a better choice. However, CopyableHeapBlock may be handy for optimisation in situations where the container elements don't need to be value-initialised and the container doesn't need to be resized.
- See also
- Array, OwnedArray, MemoryBlock, HeapBlock
|
| CopyableHeapBlock ()=default |
| Creates an empty block.
|
| CopyableHeapBlock (size_t numElementsIn) |
| Creates a block large enough to hold the specified number of elements.
|
| CopyableHeapBlock (CopyableHeapBlock &&other) noexcept |
| Moves the contents of another block into this one.
|
| CopyableHeapBlock (const CopyableHeapBlock &other) |
| Copies the contents of another block into this one.
|
CopyableHeapBlock & | operator= (CopyableHeapBlock &&other) noexcept |
| Moves the contents of another block into this one.
|
CopyableHeapBlock & | operator= (const CopyableHeapBlock &other) noexcept |
| Copies the contents of another block into this one.
|
ElementType * | data () |
| Returns a pointer to the first element in the block.
|
const ElementType * | data () const |
| Returns a pointer to the first element in the block.
|
size_t | size () const |
| Returns the number of elements in the block.
|
bool | isEmpty () const |
| Returns true if the size of the block is zero.
|
ElementType * | begin () |
| Returns a pointer to the first element in the block.
|
const ElementType * | begin () const |
| Returns a pointer to the first element in the block.
|
const ElementType * | cbegin () const |
| Returns a pointer to the first element in the block.
|
ElementType * | end () |
| Returns a pointer immediately after the last element in the block.
|
const ElementType * | end () const |
| Returns a pointer immediately after the last element in the block.
|
const ElementType * | cend () const |
| Returns a pointer immediately after the last element in the block.
|
ElementType & | operator[] (size_t index) |
| Returns a reference to the element at the provided index.
|
const ElementType & | operator[] (size_t index) const |
| Returns a reference to the element at the provided index.
|