constなオブジェクトを返す関数の必要性

const Pos& getPos() {return mPos;}
これだけだと、次のような場合に困る

const GameObj& obj = mObjMgr.getObj();
const Pos& pos = obj.getPos(); //コンパイルエラー

こーいうときは、以下のような関数も作るとOK。

const Pos& getPos() const {return mPos;}