c++ operator重载的例子
摘要:
#include <iostream>using namespace std;class A{public: A(double _data = 0.0):data(_data){} A& operator = (const A& rhs) { data = rhs.data; return *this; } friend A operator + (const A& lhs,const A& rhs); friend A operator - (const A& lhs,const A& rhs); friend A operator 阅读全文
posted @ 2011-06-09 22:06 speedmancs 阅读(29642) 评论(0) 推荐(1) 编辑