Professional C++读书笔记06
摘要:
2012-05-22Chapter091、操作符重载:实现类对象按简单类型进行+- 例:SpreadsheetCell myCell(4),anotherCell(5); SpreadsheetCell aThirdCell=myClee+anotherCell; const SpreadsheetCell operator+ (const SpreadsheetCell &cell)const; 可以实现aThirdCell=myCell+5.6这样的操作 解释:编译器会寻找一个double作参数的SpreadsheetCell的构造函数,并以5.6创建一个临时变量 但,1,诸如my 阅读全文
posted @ 2012-06-04 23:12 TheBest 阅读(108) 评论(0) 推荐(0) 编辑