From 522983549d562160c1574eeb9f2d9774394324f4 Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Mon, 4 Feb 2013 03:09:14 +0100 Subject: [PATCH] Correctly savestate std::maps with non-uint keys. --- Common/ChunkFile.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Common/ChunkFile.h b/Common/ChunkFile.h index f758726b7..91294f789 100644 --- a/Common/ChunkFile.h +++ b/Common/ChunkFile.h @@ -80,6 +80,12 @@ public: template void Do(std::map &x) + { + Do(x); + } + + template + void Do(std::map &x) { unsigned int number = (unsigned int)x.size(); Do(number); @@ -89,7 +95,7 @@ public: x.clear(); while (number > 0) { - unsigned int first = 0; + K first = 0; Do(first); T second; Do(second); @@ -102,7 +108,7 @@ public: case MODE_MEASURE: case MODE_VERIFY: { - typename std::map::iterator itr = x.begin(); + typename std::map::iterator itr = x.begin(); while (number > 0) { Do(itr->first);