2008-01-10から1日間の記事一覧

Getter のインターフェイスのパターン

info_t GetInfo() const const info_t* GetInfo() const const info_t& GetInfo() const void GetInfo(info_t* info) const void GetInfo(info_t& info) const GetInfo()->a, GetInfo.a といった利便性が高い方が良い場合もある サンプリングとしての側面を…

gcc -Waggregate-return で出る警告

info_t getInfo() では関数側も呼び出し側も warning: function returns an aggregate warning: function call has aggregate value が出る (info_t& getInfo() ならば警告はでない)