c++ c++-faq copy-constructor assignment-operator rule-of-three
class Point
{
public:
float x,y;
Point() {}
Point(float,float);
Point operator + (Point);
Point operator * (double);
void rotate_p(float);
void render_p(Point*);
void sub(float);
float get_dist();//get_distance
};
Run Code Online (Sandbox Code Playgroud)
正如你所看到的,这个类没有指针作为非静态 数据成员,所以我想我可以使用默认的析构函数; 这准确吗?