2010-04-30 36 views

回答

0

它是一個const函數(不會修改對象的任何不可變成員)成員函數,該函數返回對const CFoo的引用。

9
const CFoo& bar() const 
----------  -------- 
    ^   ^
Returns a connst  None of the member variables of the class to which bar 
reference of CFoo. method belongs to can be modified. 
         unless member variable is prefexex with keyword mutable 
+1

謝謝,佈局不錯。 – domlao 2010-04-30 03:26:52

相關問題