diff options
author | Lioncash <mathew1800@gmail.com> | 2016-04-14 01:20:23 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2016-04-14 01:20:26 +0200 |
commit | bf9945b81bf7d41c197ac8b190cab9e1c7176733 (patch) | |
tree | 66be363172591808026c90e41ff06eab2ea190d1 /src/common | |
parent | file_util: Make IOFile data members private (diff) | |
download | yuzu-bf9945b81bf7d41c197ac8b190cab9e1c7176733.tar yuzu-bf9945b81bf7d41c197ac8b190cab9e1c7176733.tar.gz yuzu-bf9945b81bf7d41c197ac8b190cab9e1c7176733.tar.bz2 yuzu-bf9945b81bf7d41c197ac8b190cab9e1c7176733.tar.lz yuzu-bf9945b81bf7d41c197ac8b190cab9e1c7176733.tar.xz yuzu-bf9945b81bf7d41c197ac8b190cab9e1c7176733.tar.zst yuzu-bf9945b81bf7d41c197ac8b190cab9e1c7176733.zip |
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/file_util.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/common/file_util.h b/src/common/file_util.h index 80e618aca..dd151575f 100644 --- a/src/common/file_util.h +++ b/src/common/file_util.h @@ -192,6 +192,9 @@ public: template <typename T> size_t ReadArray(T* data, size_t length) { + static_assert(std::is_standard_layout<T>(), "Given array does not consist of standard layout objects"); + static_assert(std::is_trivially_copyable<T>(), "Given array does not consist of trivially copyable objects"); + if (!IsOpen()) { m_good = false; return -1; @@ -207,9 +210,8 @@ public: template <typename T> size_t WriteArray(const T* data, size_t length) { - static_assert(std::is_standard_layout<T>::value, "Given array does not consist of standard layout objects"); - // TODO: gcc 4.8 does not support is_trivially_copyable, but we really should check for it here. - //static_assert(std::is_trivially_copyable<T>::value, "Given array does not consist of trivially copyable objects"); + static_assert(std::is_standard_layout<T>(), "Given array does not consist of standard layout objects"); + static_assert(std::is_trivially_copyable<T>(), "Given array does not consist of trivially copyable objects"); if (!IsOpen()) { m_good = false; |