@@ -74,9 +74,9 @@ template <typename TKey, typename TValue, unsigned kNumInlineItems = 1, typename
74
74
75
75
static inline constexpr uint32_t k_MinNumberOfBuckets = 16 ;
76
76
77
- template <typename T, class ... Args> static void construct (void * EXLBR_RESTRICT ptr, Args&&... args)
77
+ template <typename T, class ... Args> static T* construct (void * EXLBR_RESTRICT ptr, Args&&... args)
78
78
{
79
- new (ptr) T (std::forward<Args>(args)...);
79
+ return new (ptr) T (std::forward<Args>(args)...);
80
80
}
81
81
template <typename T> static void destruct (T* EXLBR_RESTRICT ptr) { ptr->~T (); }
82
82
@@ -105,7 +105,7 @@ template <typename TKey, typename TValue, unsigned kNumInlineItems = 1, typename
105
105
[[nodiscard]] inline TValue* value () noexcept
106
106
{
107
107
TValue* value = reinterpret_cast <TValue*>(&m_value);
108
- return value;
108
+ return std::launder ( value) ;
109
109
}
110
110
};
111
111
};
@@ -278,7 +278,7 @@ template <typename TKey, typename TValue, unsigned kNumInlineItems = 1, typename
278
278
TItem* otherInlineItem = (otherInlineItems + i);
279
279
const bool hasValidValue = otherInlineItem->isValid ();
280
280
// move construct key
281
- construct<TItem>((inlineItems + i) , std::move (*otherInlineItem->key ()));
281
+ inlineItem = construct<TItem>(inlineItem , std::move (*otherInlineItem->key ()));
282
282
283
283
// move inline storage value (if any)
284
284
if (hasValidValue)
0 commit comments