feat(memory): add template function overload for Memmove and Memcmp

This commit is contained in:
2022-12-15 23:37:41 +08:00
parent 015b6df809
commit 6b42dbdc05
2 changed files with 24 additions and 1 deletions

View File

@ -53,6 +53,20 @@ FORCEINLINE void* Memcpy(void* Destination, const void* Source, size_t Count)
return std::memcpy(Destination, Source, Count);
}
template <typename T>
FORCEINLINE void Memmove(T& Destination, const T& Source)
{
static_assert(!CPointer<T>, "For pointers use the three parameters function");
Memmove(&Destination, &Source, sizeof(T));
}
template <typename T>
FORCEINLINE int32 Memcmp(const T& BufferLHS, const T& BufferRHS)
{
static_assert(!CPointer<T>, "For pointers use the three parameters function");
return Memcmp(&BufferLHS, &BufferRHS, sizeof(T));
}
template <typename T>
FORCEINLINE void Memset(T& Source, uint8 ValueToSet)
{