file_util: Remove compiler version checks around is_trivially_copyable()
The minimum clang/GCC versions we support already support this. We can also remove is_standard_layout(), as fread and fwrite only require the type to be trivially copyable.
This commit is contained in:
parent
47025552c7
commit
a74ba1cd59
@ -175,12 +175,8 @@ public:
|
|||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
size_t ReadArray(T* data, size_t length) {
|
size_t ReadArray(T* data, size_t length) {
|
||||||
static_assert(std::is_standard_layout<T>(),
|
|
||||||
"Given array does not consist of standard layout objects");
|
|
||||||
#if (__GNUC__ >= 5) || defined(__clang__) || defined(_MSC_VER)
|
|
||||||
static_assert(std::is_trivially_copyable<T>(),
|
static_assert(std::is_trivially_copyable<T>(),
|
||||||
"Given array does not consist of trivially copyable objects");
|
"Given array does not consist of trivially copyable objects");
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!IsOpen()) {
|
if (!IsOpen()) {
|
||||||
m_good = false;
|
m_good = false;
|
||||||
@ -196,12 +192,8 @@ public:
|
|||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
size_t WriteArray(const T* data, size_t length) {
|
size_t WriteArray(const T* data, size_t length) {
|
||||||
static_assert(std::is_standard_layout<T>(),
|
|
||||||
"Given array does not consist of standard layout objects");
|
|
||||||
#if (__GNUC__ >= 5) || defined(__clang__) || defined(_MSC_VER)
|
|
||||||
static_assert(std::is_trivially_copyable<T>(),
|
static_assert(std::is_trivially_copyable<T>(),
|
||||||
"Given array does not consist of trivially copyable objects");
|
"Given array does not consist of trivially copyable objects");
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!IsOpen()) {
|
if (!IsOpen()) {
|
||||||
m_good = false;
|
m_good = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user