diff --git a/ExcaliburHash/ExcaliburHash.h b/ExcaliburHash/ExcaliburHash.h index 97f76b7..50f4770 100644 --- a/ExcaliburHash/ExcaliburHash.h +++ b/ExcaliburHash/ExcaliburHash.h @@ -74,9 +74,9 @@ template static void construct(void* EXLBR_RESTRICT ptr, Args&&... args) + template static T* construct(void* EXLBR_RESTRICT ptr, Args&&... args) { - new (ptr) T(std::forward(args)...); + return new (ptr) T(std::forward(args)...); } template static void destruct(T* EXLBR_RESTRICT ptr) { ptr->~T(); } @@ -105,7 +105,7 @@ template (&m_value); - return value; + return std::launder(value); } }; }; @@ -278,7 +278,7 @@ template isValid(); // move construct key - construct((inlineItems + i), std::move(*otherInlineItem->key())); + inlineItem = construct(inlineItem, std::move(*otherInlineItem->key())); // move inline storage value (if any) if (hasValidValue)