std::unordered_map<int, int> _cache;
std::vector<std::unordered_map<int, int>::iterator> _lruList;
이std :: unordered_map 반복기를 증가시킬 수없는 이유는 무엇입니까?
std::rotate(_lruList.begin(), _lruList.begin() + 1, _lruList.end());
작동하지만, 이것은하지 않습니다 하나가 vector
입니다 제외하고 그들은 모두 반복자이기 때문에 정말 이해가되지 않습니다
std::rotate(_cache.begin(), _cache.begin() + 1, _cache.end()); // error occurs on _cache.begin() + 1 saying "error type"
하나는 unordered_map
다음으로 나는 LSO이 std::rotate(_cache.begin(), _cache.begin() ++, _cache.end());
을 시도했지만 나는 다음과 같은 오류를 가지고 : _Left: you can't assign to a variable that is const
_Right: you can't assign to a variable that is const
알 수 있습니다. 자세한 설명을 해주셔서 감사합니다! – ygongdev