diff options
| -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: | |||
| 192 | template <typename T> | 192 | template <typename T> |
| 193 | size_t ReadArray(T* data, size_t length) | 193 | size_t ReadArray(T* data, size_t length) |
| 194 | { | 194 | { |
| 195 | static_assert(std::is_standard_layout<T>(), "Given array does not consist of standard layout objects"); | ||
| 196 | static_assert(std::is_trivially_copyable<T>(), "Given array does not consist of trivially copyable objects"); | ||
| 197 | |||
| 195 | if (!IsOpen()) { | 198 | if (!IsOpen()) { |
| 196 | m_good = false; | 199 | m_good = false; |
| 197 | return -1; | 200 | return -1; |
| @@ -207,9 +210,8 @@ public: | |||
| 207 | template <typename T> | 210 | template <typename T> |
| 208 | size_t WriteArray(const T* data, size_t length) | 211 | size_t WriteArray(const T* data, size_t length) |
| 209 | { | 212 | { |
| 210 | static_assert(std::is_standard_layout<T>::value, "Given array does not consist of standard layout objects"); | 213 | static_assert(std::is_standard_layout<T>(), "Given array does not consist of standard layout objects"); |
| 211 | // TODO: gcc 4.8 does not support is_trivially_copyable, but we really should check for it here. | 214 | static_assert(std::is_trivially_copyable<T>(), "Given array does not consist of trivially copyable objects"); |
| 212 | //static_assert(std::is_trivially_copyable<T>::value, "Given array does not consist of trivially copyable objects"); | ||
| 213 | 215 | ||
| 214 | if (!IsOpen()) { | 216 | if (!IsOpen()) { |
| 215 | m_good = false; | 217 | m_good = false; |