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).
This commit is contained in:
parent
ad84b904e4
commit
ea0335f7c1
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue