Point.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. class Point
  3. {
  4. double m_x, m_y;
  5. public:
  6. explicit Point(double x = 0, double y = 0);//constructor
  7. Point(const Point&);//copy-constructor
  8. Point(Point&&);//move copy-constructor
  9. ~Point();//destructor
  10. void Get_all(double&, double&);//ëèáî friend operator-=
  11. void Get_all(double&, double&) const;
  12. void Set_all(double&, double&);
  13. /*friend void operator-=(Point& This, const Point& Other) { This.m_x -= Other.m_x; This.m_y -= Other.m_y; };
  14. friend Point operator+(const double num, const Point& other){return Point(other.m_x + num, other.m_y + num);};
  15. friend Point operator-(const Point& thirst, const double num){return Point(thirst.m_x - num, thirst.m_y - num);};
  16. friend Point operator-(const Point& thirst, const Point& second){return Point(thirst.m_x - second.m_x, thirst.m_y - second.m_y);};*/
  17. Point& operator=(const Point&);
  18. Point& operator=(Point&&);
  19. Point operator+(const Point&) const;
  20. Point operator+(const double) const;
  21. //Point& operator+(Point&&); ???
  22. Point& operator+=(const Point&);
  23. Point& operator+=(const double);
  24. //Point& operator+=(Point&&); ???
  25. Point operator+() const;
  26. Point operator-() const;
  27. };
  28. Point operator+(const double, const Point&);
  29. Point operator-(const Point&, const double);
  30. Point operator-(const Point&, const Point&);
  31. Point& operator-=(Point&, const Point&);