Ticket #631: destory.diff
File destory.diff, 2.7 KB (added by , 4 years ago) |
---|
-
lemon/bits/array_map.
old new 219 219 int jd = nf->id(it);; 220 220 if (id != jd) { 221 221 allocator.construct(&(new_values[jd]), values[jd]); 222 allocator.destroy(&(values[jd]));222 std::allocator_traits<std::allocator<Value>>::destroy(allocator, &(values[jd])); 223 223 } 224 224 } 225 225 if (capacity != 0) allocator.deallocate(values, capacity); … … 261 261 } 262 262 if (found) continue; 263 263 allocator.construct(&(new_values[id]), values[id]); 264 allocator.destroy(&(values[id]));264 std::allocator_traits<std::allocator<Value>>::destroy(allocator, &(values[id])); 265 265 } 266 266 if (capacity != 0) allocator.deallocate(values, capacity); 267 267 values = new_values; … … 279 279 // and it overrides the erase() member function of the observer base. 280 280 virtual void erase(const Key& key) { 281 281 int id = Parent::notifier()->id(key); 282 allocator.destroy(&(values[id]));282 std::allocator_traits<std::allocator<Value>>::destroy(allocator, &(values[id])); 283 283 } 284 284 285 285 // \brief Erase more keys from the map. … … 289 289 virtual void erase(const std::vector<Key>& keys) { 290 290 for (int i = 0; i < int(keys.size()); ++i) { 291 291 int id = Parent::notifier()->id(keys[i]); 292 allocator.destroy(&(values[id]));292 std::allocator_traits<std::allocator<Value>>::destroy(allocator, &(values[id])); 293 293 } 294 294 } 295 295 … … 317 317 Item it; 318 318 for (nf->first(it); it != INVALID; nf->next(it)) { 319 319 int id = nf->id(it); 320 allocator.destroy(&(values[id]));320 std::allocator_traits<std::allocator<Value>>::destroy(allocator, &(values[id])); 321 321 } 322 322 allocator.deallocate(values, capacity); 323 323 capacity = 0; -
lemon/path.
old new 582 582 void clear() { 583 583 while (first != 0) { 584 584 last = first->next; 585 alloc.destroy(first);585 std::allocator_traits<std::allocator<Node>>::destroy(alloc, first); 586 586 alloc.deallocate(first, 1); 587 587 first = last; 588 588 } … … 617 617 } else { 618 618 last = 0; 619 619 } 620 alloc.destroy(node);620 std::allocator_traits<std::allocator<Node>>::destroy(alloc, node); 621 621 alloc.deallocate(node, 1); 622 622 } 623 623 … … 650 650 } else { 651 651 first = 0; 652 652 } 653 alloc.destroy(node);653 std::allocator_traits<std::allocator<Node>>::destroy(alloc, node); 654 654 alloc.deallocate(node, 1); 655 655 } 656 656