| 186 | SparsePagedArray(SparsePagedArray &&) = delete; |
| 187 | |
| 188 | void set(uint32_t index, T const& value) |
| 189 | { |
| 190 | if (mask_[index]) { |
| 191 | // Value in slot already constructed |
| 192 | values_[index] = value; |
| 193 | } else { |
| 194 | // Need to construct in place, slot is empty |
| 195 | if (index >= mask_.size()) { |
| 196 | mask_.resize(index + 1); |
| 197 | values_.reallocExtern<TAllocator>(index + 1, mask_.allocator()); |
| 198 | } |
| 199 | |
| 200 | mask_.set(index); |
| 201 | new (&values_[index]) T(value); |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | void set(uint32_t index, T&& value) |
| 206 | { |