@@ -45,6 +45,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4545#include " Optional.h"
4646#include " String.h"
4747
48+ #include " Type.h"
49+
4850namespace Util {
4951
5052 /*
@@ -229,7 +231,7 @@ namespace Util {
229231 // This is only safe to use if every possible byte sequence represents a valid value for the
230232 // object. So it cannot be used for bool or a struct containing a bool.
231233 template <typename T>
232- struct SerializeTraits <T, typename std::enable_if<std::is_pod <T>::value && !std::is_array<T>::value>::type> {
234+ struct SerializeTraits <T, typename std::enable_if<IsPod <T> && !std::is_array<T>::value>::type> {
233235 static void Write (Writer& stream, const T& value)
234236 {
235237 stream.WriteData (std::addressof (value), sizeof (value));
@@ -257,7 +259,7 @@ namespace Util {
257259
258260 // std::array for non-POD types (POD types are already handled by the base case)
259261 template <typename T, size_t N>
260- struct SerializeTraits <std::array<T, N>, typename std::enable_if<!std::is_pod <T>::value >::type> {
262+ struct SerializeTraits <std::array<T, N>, typename std::enable_if<!IsPod <T>>::type> {
261263 static void Write (Writer& stream, const std::array<T, N>& value)
262264 {
263265 for (const T& x: value)
@@ -274,7 +276,7 @@ namespace Util {
274276
275277 // std::vector, with a specialization for POD types
276278 template <typename T>
277- struct SerializeTraits <std::vector<T>, typename std::enable_if<std::is_pod <T>::value >::type> {
279+ struct SerializeTraits <std::vector<T>, typename std::enable_if<IsPod <T>>::type> {
278280 static void Write (Writer& stream, const std::vector<T>& value)
279281 {
280282 stream.WriteSize (value.size ());
@@ -289,7 +291,7 @@ namespace Util {
289291 }
290292 };
291293 template <typename T>
292- struct SerializeTraits <std::vector<T>, typename std::enable_if<!std::is_pod <T>::value >::type> {
294+ struct SerializeTraits <std::vector<T>, typename std::enable_if<!IsPod <T>>::type> {
293295 static void Write (Writer& stream, const std::vector<T>& value)
294296 {
295297 stream.WriteSize (value.size ());
0 commit comments