Misc: Replace deprecated std::is_pod

This commit is contained in:
Stenzek 2023-09-05 21:27:27 +10:00
parent a66fec4266
commit 519367555b
2 changed files with 5 additions and 5 deletions

View file

@ -54,7 +54,7 @@ public:
return ref;
}
template<class Y = T, std::enable_if_t<std::is_pod_v<Y>, int> = 0>
template<class Y = T, std::enable_if_t<std::is_standard_layout_v<Y> && std::is_trivial_v<Y>, int> = 0>
T& Push(const T& value)
{
T& ref = PushAndGetReference();
@ -62,7 +62,7 @@ public:
return ref;
}
template<class Y = T, std::enable_if_t<!std::is_pod_v<Y>, int> = 0>
template<class Y = T, std::enable_if_t<!std::is_standard_layout_v<Y> || !std::is_trivial_v<Y>, int> = 0>
T& Push(const T& value)
{
T& ref = PushAndGetReference();
@ -71,7 +71,7 @@ public:
}
// faster version of push_back_range for POD types which can be memcpy()ed
template<class Y = T, std::enable_if_t<std::is_pod_v<Y>, int> = 0>
template<class Y = T, std::enable_if_t<std::is_standard_layout_v<Y>&& std::is_trivial_v<Y>, int> = 0>
void PushRange(const T* data, u32 size)
{
DebugAssert((m_size + size) <= CAPACITY);
@ -91,7 +91,7 @@ public:
m_size += size;
}
template<class Y = T, std::enable_if_t<!std::is_pod_v<Y>, int> = 0>
template<class Y = T, std::enable_if_t<!std::is_standard_layout_v<Y> || !std::is_trivial_v<Y>, int> = 0>
void PushRange(const T* data, u32 size)
{
DebugAssert((m_size + size) <= CAPACITY);

View file

@ -74,7 +74,7 @@ public:
}
/// Overload for POD types, such as structs.
template<typename T, std::enable_if_t<std::is_pod_v<T>, int> = 0>
template<typename T, std::enable_if_t<std::is_standard_layout_v<T> && std::is_trivial_v<T>, int> = 0>
void DoPOD(T* value_ptr)
{
if (m_mode == Mode::Read)