- 133 名前:デフォルトの名無しさん mailto:sage [2007/08/13(月) 14:57:53 ]
- gcc の _attribute((const)) みたいなもんがあればいいのかも。
・関数の戻り値が引数とインスタンスの内容にのみ依存する。 つまり、 class Test { public: int foo() __attribute__((const)); void bar() const; }; Test T; int a = T.foo(); T.bar(); int b = T.foo(); // int b = a; に最適化できる。
|

|