[ox] Correct bad bit_cast uses and improve constexpr-ness

This commit is contained in:
2021-11-28 21:03:29 -06:00
parent 22f08f83c5
commit 1f24912ddd
35 changed files with 247 additions and 214 deletions

View File

@@ -161,7 +161,7 @@ Result<T&> HashMap<K, T>::at(K k) noexcept {
auto p = access(m_pairs, k);
if (!p) {
AllocAlias<T> v;
return {*bit_cast<T*>(&v), OxError(1)};
return {*reinterpret_cast<T*>(&v), OxError(1)};
}
return p->value;
}
@@ -190,7 +190,7 @@ Result<const T&> HashMap<K, T>::at(K k) const noexcept {
auto p = access(m_pairs, k);
if (!p) {
AllocAlias<T> v;
return {*bit_cast<T*>(&v), OxError(1)};
return {*reinterpret_cast<T*>(&v), OxError(1)};
}
return p->value;
}