| 687 | } |
| 688 | |
| 689 | inline void reinsert(size_t numBucketsNew, TItem* EXLBR_RESTRICT item, TItem* const enditem) noexcept |
| 690 | { |
| 691 | // re-insert existing elements |
| 692 | for (; item != enditem; item++) |
| 693 | { |
| 694 | if (item->isValid()) |
| 695 | { |
| 696 | if constexpr (has_values::value) |
| 697 | { |
| 698 | emplaceToExisting(numBucketsNew, std::move(*item->key()), std::move(*item->value())); |
| 699 | } |
| 700 | else |
| 701 | { |
| 702 | emplaceToExisting(numBucketsNew, std::move(*item->key())); |
| 703 | } |
| 704 | |
| 705 | // destroy old value if need |
| 706 | if constexpr ((!std::is_trivially_destructible<TValue>::value) && (has_values::value)) |
| 707 | { |
| 708 | destruct(item->value()); |
| 709 | } |
| 710 | } |
| 711 | |
| 712 | // note: this won't automatically call value dtors! |
| 713 | destruct(item); |
| 714 | } |
| 715 | } |
| 716 | |
| 717 | template <typename TK, class... Args> |
| 718 | inline std::pair<IteratorKV, bool> emplaceReallocate(uint32_t numBucketsNew, TK&& key, Args&&... args) |
no test coverage detected