diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2017-01-14 17:38:35 +0100 |
|---|---|---|
| committer | Léo Lam <leo@innovatetechnologi.es> | 2017-01-14 19:00:19 +0100 |
| commit | ea0335f7c1308e61bfa4f83af0b6dff68a2b1bbb (patch) | |
| tree | b1711a56b925b975087571b7fb2bd4e36fcb90c5 /Source/Core/Common/ChunkFile.h | |
| parent | ad84b904e4123e02bd6aec198cc73bfb0f254aca (diff) | |
Fix ChunkFile for std::set
Without this, attempts to savestate std::set will fail with an error
about dropping the const qualifier.
<Lioncash> leoetlino: I'll try to break it down: So, when you do a
ranged-for on a container, it's essentially syntactic sugar over begin
and end iterators. std::set is an associative container where the key
type is the same as the value type, and so it's required that all
iterator functions return constant iterators. If this wasn't a
requirement, it would allow changing the ordering of elements from
outside of the set's API (this is bad).
Diffstat (limited to 'Source/Core/Common/ChunkFile.h')
| -rw-r--r-- | Source/Core/Common/ChunkFile.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/Core/Common/ChunkFile.h b/Source/Core/Common/ChunkFile.h index 64e2a10b50..0fe2a81667 100644 --- a/Source/Core/Common/ChunkFile.h +++ b/Source/Core/Common/ChunkFile.h @@ -120,7 +120,7 @@ public: case MODE_WRITE: case MODE_MEASURE: case MODE_VERIFY: - for (V& val : x) + for (const V& val : x) { Do(val); } |
