diff --git a/Framework/Utilities.h b/Framework/Utilities.h index 91900c9..7572b21 100644 --- a/Framework/Utilities.h +++ b/Framework/Utilities.h @@ -3,7 +3,7 @@ #include -#include // mingw32 should be cstdint +#include #include @@ -216,24 +216,11 @@ extern Module g_currentModule; -#ifdef NO_IS_POD -# define ASSERT_IS_POD(T, msg) -#else -# define ASSERT_IS_POD(T, msg) \ - static_assert(std::is_pod::value, msg); -#endif - - -#ifdef NO_NULLPTR -# define nullptr NULL -#endif - - // std::vector replacement that is cut down but familiar, uses the custom allocators, and restricted to POD elements only template struct PODArrayPOD // A dynamic array of POD type elements which is itself a POD type (so can have multi-dimensional arrays of these). { - ASSERT_IS_POD(T, "T must be a POD type."); + static_assert(std::is_pod::value, "T must be a POD type."); void init() { m_magic = 0x01020304; m_capacity = m_size = 0; m_data = nullptr; } void deinit() { if (m_data != nullptr) YQ_FREE(m_data); } @@ -263,18 +250,16 @@ }; -ASSERT_IS_POD(PODArrayPOD, "PODArrayPOD must be a POD type."); +static_assert(std::is_pod >::value, "PODArrayPOD must be a POD type."); template struct ArrayPOD // A dynamic array of POD type elements. It isn't POD itself, but is instead reference counted so safer to deal with. { - ASSERT_IS_POD(T, "T must be a POD type."); + static_assert(std::is_pod::value, "T must be a POD type."); -#ifndef NO_CPP11 ArrayPOD& operator=(const ArrayPOD&) = delete; ArrayPOD(const ArrayPOD&) = delete; -#endif ArrayPOD() { m_capacity = m_size = 0; m_data = nullptr; } ~ArrayPOD() { if (m_data != nullptr) YQ_FREE(m_data); } @@ -314,7 +299,7 @@ }; -ASSERT_IS_POD(PODString, "PODString must be a POD type."); +static_assert(std::is_pod::value, "PODString must be a POD type."); /*