خرید بک لینک

Vote count: 0

std::unordered_map<int, int> _cache;

std::vector<std::unordered_map<int, int>::iterator> _lruList;

this works

std::rotate(_lruList.begin(), _lruList.begin() + 1, _lruList.end());

but this doesn't

std::rotate(_cache.begin(), _cache.begin() + 1, _cache.end()); // error occurs on _cache.begin() + 1 saying "error type"

Which doesn't really make sense to me because they are both iterators except one is for a vector and one is for a unordered_map

Then I also tried this std::rotate(_cache.begin(), _cache.begin() ++, _cache.end());

but I got the following errors: _Left: you can't assign to a variable that is const _Right: you can't assign to a variable that is const

asked 55 secs ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 30 خرداد 1395 ساعت: 13:21

صفحه بندی