diff --git a/SDL2pp/Point.cc b/SDL2pp/Point.cc index 05417e9..532c0a1 100644 --- a/SDL2pp/Point.cc +++ b/SDL2pp/Point.cc @@ -50,6 +50,8 @@ Point::Point(const Point& other) { } } +Point::Point(Point&&) noexcept = default; + Point& Point::operator=(const Point& other) { if (other.point_.get()) { point_.reset(new SDL_Point); @@ -59,6 +61,8 @@ Point& Point::operator=(const Point& other) { return *this; } +Point& Point::operator=(Point&&) noexcept = default; + bool Point::operator==(const Point& other) const { if (!point_ || !other.point_) return point_ == other.point_; // true only if both null diff --git a/SDL2pp/Point.hh b/SDL2pp/Point.hh index 72888d6..68d67e5 100644 --- a/SDL2pp/Point.hh +++ b/SDL2pp/Point.hh @@ -52,9 +52,9 @@ public: static Point Null(); Point(const Point& other); - Point(Point&&) noexcept = default; + Point(Point&&) noexcept; Point& operator=(const Point& other); - Point& operator=(Point&&) noexcept = default; + Point& operator=(Point&&) noexcept; bool operator==(const Point& other) const; bool operator!=(const Point& other) const; diff --git a/SDL2pp/Rect.cc b/SDL2pp/Rect.cc index 1487de6..7f1d7b5 100644 --- a/SDL2pp/Rect.cc +++ b/SDL2pp/Rect.cc @@ -54,6 +54,8 @@ Rect::Rect(const Rect& other) { } } +Rect::Rect(Rect&&) noexcept = default; + Rect& Rect::operator=(const Rect& other) { if (other.rect_.get()) { rect_.reset(new SDL_Rect); @@ -65,6 +67,8 @@ Rect& Rect::operator=(const Rect& other) { return *this; } +Rect& Rect::operator=(Rect&&) noexcept = default; + bool Rect::operator==(const Rect& other) const { if (!rect_ || !other.rect_) return rect_ == other.rect_; // true only if both null diff --git a/SDL2pp/Rect.hh b/SDL2pp/Rect.hh index 3df81ff..7c9f32f 100644 --- a/SDL2pp/Rect.hh +++ b/SDL2pp/Rect.hh @@ -44,9 +44,9 @@ public: static Rect FromCenter(int cx, int cy, int w, int h); Rect(const Rect& other); - Rect(Rect&&) noexcept = default; + Rect(Rect&&) noexcept; Rect& operator=(const Rect& other); - Rect& operator=(Rect&&) noexcept = default; + Rect& operator=(Rect&&) noexcept; bool operator==(const Rect& other) const; bool operator!=(const Rect& other) const;