C++

constメンバ関数でもmutableなメンバ変数なら修正できる

C++

以下はmutableなメンバ変数をconstメンバ関数から修正する実験用コードです。 #include <iostream> using namespace std; class Hoge { mutable int hogeMutable; public: int GetHogeMutable() const { return hogeMutable; } void SetHogeMutable(int hoge) const { </iostream>…