若想禁止類對象的拷貝/賦值等操作,可通過將拷貝及賦值操作相關接口定義爲私有,具體可參考單例模式及leveldb::cache
private:
void LRU_Remove(Handle* e);
void LRU_Append(Handle* e);
void Unref(Handle* e);
struct Rep;
Rep* rep_;
// No copying allowed
Cache(const Cache&);
void operator=(const Cache&);