冒号后跟着的是赋值操作,这种写法是c++的特性 比如,LRUcache(int capacity) : cap(capacity){ } 相当于 LRUcache(int capacity) { cap=capacity; }