Const iterators
Hello, thanks for thsi very usefu llibrary! I have one question as I must be missing something - why there are only const ways of iterating over entire slot_map?
const_values_iterator begin() const noexcept
const_values_iterator end() const noexcept
Const values iterator
for (const auto& value : slotMap)
{
...
}
Items items() const noexcept
Const key/value iterator
for (const auto& [key, value] : slotMap.items())
{
...
}
I wanted to use them for components that should be in relatively continuous memory for iterating over all of them to apply some state changes, and I also need handles to access them in a singular manner. Why there are no non-const iterators over slotmap's value? I'm sure there must be some reason but wanted to understand it. Being able to change internals of object held in a slotmap doesn't seem to affect the slotmap itself?
I found a way around it by iterating with range-for over the slotmap to get the handle and then using get(handle) for each one of them but I feel this may not be the most efficient way, assuming it should be possible to just go over entire collection via iterator?