2007-05-11 constなオブジェクトを返す関数の必要性 c++ const Pos& getPos() {return mPos;} これだけだと、次のような場合に困るconst GameObj& obj = mObjMgr.getObj(); const Pos& pos = obj.getPos(); //コンパイルエラーこーいうときは、以下のような関数も作るとOK。const Pos& getPos() const {return mPos;}