mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
ChunkFile has allowed me to accidentally "Do" a non-POD for the last time!
This commit is contained in:
@ -32,6 +32,7 @@
|
||||
#include <list>
|
||||
#include <deque>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
#include "Common.h"
|
||||
#include "FileUtil.h"
|
||||
@ -139,11 +140,17 @@ public:
|
||||
template <typename T>
|
||||
void Do(T& x)
|
||||
{
|
||||
// TODO: Bad, Do(some_non_POD) will compile and fail at runtime
|
||||
// type_traits are not fully supported everywhere yet
|
||||
// Ideally this would be std::is_trivially_copyable, but not enough support yet
|
||||
static_assert(std::is_pod<T>::value, "Only sane for POD types");
|
||||
|
||||
DoVoid((void*)&x, sizeof(x));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void DoPOD(T& x)
|
||||
{
|
||||
DoVoid((void*)&x, sizeof(x));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void DoPointer(T*& x, T* const base)
|
||||
|
Reference in New Issue
Block a user