Код: Выделить всё
template
void LfuCache::removeFromFreqHash(NodePtr& node) {
unsigned int index;
index = node->getFrequency();
FreqPtr freqPtr = this->freqHash_[index];
freqPtr->removeNode(node);
if (index = this->minFreq_) {
if (freqPtr->isEmpty()) {
updateMinFreq();
}
}
}
Ниже приведен частичный код < /p>
template
class LfuCache :public ICachePolicy {
private:
using Node = LfuNode;
using NodePtr = shared_ptr;
using NodeHash = unordered_map;
using FreqList = NodeList;
using FreqPtr = shared_ptr;
using FreqHash = unordered_map;
};
template
class LfuNode {
private:
Key key_;
Value value_;
unsigned int freq_;
shared_ptr pre_;
shared_ptr next_;
public:
LfuNode() = delete;
LfuNode(Key key, Value value)
: key_{ key }
, value_{ value }
, freq_{ 1 }
, pre_{ nullptr }
, next_{ nullptr }
{}
unsigned int getFrequency() { return freq_; }
};
< /code>
может кто -нибудь знает, пожалуйста, скажите мне причину этого и как это решить
Большое спасибо! < /p>
Подробнее здесь: https://stackoverflow.com/questions/794 ... usand-time