Core/Misc: Fixed deprecation warnings for c++20

This commit is contained in:
Shauren
2023-01-01 00:26:53 +01:00
parent fa361a40c8
commit ba9bbbc9d0
24 changed files with 86 additions and 84 deletions

View File

@@ -6,7 +6,7 @@ index c562f5c920f7..c86b20fd7e97 100644
/** Resizes this to match the size of \a other and then copies the data from other using memcpy. This is only safe for POD types */
void copyPOD(const Array<T>& other) {
+ static_assert(std::is_pod<T>::value, "copyPOD called on non-POD type");
+ static_assert(std::is_standard_layout_v<T> && std::is_trivial_v<T>, "copyPOD called on non-POD type");
if (numAllocated < other.num) {
m_memoryManager->free(data);
data = NULL;
@@ -14,7 +14,7 @@ index c562f5c920f7..c86b20fd7e97 100644
/** Resizes this to just barely match the size of \a other + itself and then copies the data to the end of the array from other using memcpy.
This is only safe for POD types */
void appendPOD(const Array<T>& other) {
+ static_assert(std::is_pod<T>::value, "appendPOD called on non-POD type");
+ static_assert(std::is_standard_layout_v<T> && std::is_trivial_v<T>, "appendPOD called on non-POD type");
const size_t oldSize = num;
num += other.num;
if (numAllocated < num) {

View File

@@ -346,7 +346,7 @@ public:
/** Resizes this to match the size of \a other and then copies the data from other using memcpy. This is only safe for POD types */
void copyPOD(const Array<T>& other) {
static_assert(std::is_pod<T>::value, "copyPOD called on non-POD type");
static_assert(std::is_standard_layout_v<T> && std::is_trivial_v<T>, "copyPOD called on non-POD type");
if (numAllocated < other.num) {
m_memoryManager->free(data);
data = NULL;
@@ -365,7 +365,7 @@ public:
/** Resizes this to just barely match the size of \a other + itself and then copies the data to the end of the array from other using memcpy.
This is only safe for POD types */
void appendPOD(const Array<T>& other) {
static_assert(std::is_pod<T>::value, "appendPOD called on non-POD type");
static_assert(std::is_standard_layout_v<T> && std::is_trivial_v<T>, "appendPOD called on non-POD type");
const size_t oldSize = num;
num += other.num;
if (numAllocated < num) {