@brief Clears the stable array by calling the destructor of each element. @note Does not release reserved memory (use release() for that).
| 29 | /// @brief Clears the stable array by calling the destructor of each element. |
| 30 | /// @note Does not release reserved memory (use release() for that). |
| 31 | void clear() |
| 32 | { |
| 33 | T* items = data(); |
| 34 | while (sizeElements > 0) |
| 35 | { |
| 36 | sizeElements--; |
| 37 | items[sizeElements].~T(); |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | /// @brief Clears the array calling destructors of each element and releases virtual memory. |
| 42 | [[nodiscard]] bool clearAndDecommit() |