第六十九課、自定義內存管理

一、統計對象中某個成員變量的訪問次數 解決方法一: #include <iostream> using namespace std; class Test { private: int i; mutable int m_count; public: Test(int v) { i = v; m_count = 0; } void setI(int v) { i = v; m_count++; }
相關文章
相關標籤/搜索