refactor(miscellaneous): clarify which fundamental types are used where

This commit is contained in:
2024-11-24 20:09:31 +08:00
parent 54c795b9a2
commit bcc39fdf55
3 changed files with 13 additions and 13 deletions

View File

@ -75,7 +75,7 @@ public:
// Make sure you call this function after you have destroyed the held object using Destroy().
template <typename T, typename U>
FORCEINLINE constexpr void Emplace(intptr InCallable, U&& Args)
FORCEINLINE constexpr void Emplace(uintptr InCallable, U&& Args)
{
static_assert(CSameAs<TDecay<T>, TDecay<U>>);
ValuePtr = reinterpret_cast<uintptr>(AddressOf(Args));

View File

@ -53,7 +53,7 @@ FORCEINLINE constexpr size_t GetTypeHash(T A)
if constexpr (sizeof(T) == 8) return GetTypeHash(static_cast<uint32>(A)) ^ GetTypeHash(static_cast<uint32>(A >> 32));
if constexpr (sizeof(T) == 16) return GetTypeHash(static_cast<uint64>(A)) ^ GetTypeHash(static_cast<uint64>(A >> 64));
else check_no_entry();
return INDEX_NONE;
}
@ -69,7 +69,7 @@ FORCEINLINE constexpr size_t GetTypeHash(T A)
if constexpr (sizeof(T) == 8) return GetTypeHash(*reinterpret_cast<uint64*>(&A));
if constexpr (sizeof(T) == 16) return GetTypeHash(*reinterpret_cast<uint64*>(&A) ^ *(reinterpret_cast<uint64*>(&A) + 1));
else check_no_entry();
return INDEX_NONE;
}
@ -84,7 +84,7 @@ FORCEINLINE constexpr size_t GetTypeHash(T A)
template <typename T> requires (CPointer<T> || CSameAs<T, nullptr_t>)
FORCEINLINE constexpr size_t GetTypeHash(T A)
{
return GetTypeHash(reinterpret_cast<intptr>(A));
return GetTypeHash(reinterpret_cast<uintptr>(A));
}
/** Overloads the GetTypeHash algorithm for T::hash_code(). */