From d2bb3203067343b51bf3c543b331741f6fa4ad21 Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 7 Apr 2019 12:20:58 +1000 Subject: Make XPM, RGBAImage, and LineMarker copyable and noexcept moveable. This simplifies and optimizes their use in other classes and containers. --- src/XPM.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/XPM.h') diff --git a/src/XPM.h b/src/XPM.h index c3c1fc3b3..b7b895cdd 100644 --- a/src/XPM.h +++ b/src/XPM.h @@ -25,10 +25,10 @@ class XPM { public: explicit XPM(const char *textForm); explicit XPM(const char *const *linesForm); - XPM(const XPM &) = delete; - XPM(XPM &&) = delete; - XPM &operator=(const XPM &) = delete; - XPM &operator=(XPM &&) = delete; + XPM(const XPM &) = default; + XPM(XPM &&) noexcept = default; + XPM &operator=(const XPM &) = default; + XPM &operator=(XPM &&) noexcept = default; ~XPM(); void Init(const char *textForm); void Init(const char *const *linesForm); @@ -52,11 +52,10 @@ class RGBAImage { public: RGBAImage(int width_, int height_, float scale_, const unsigned char *pixels_); explicit RGBAImage(const XPM &xpm); - // Deleted so RGBAImage objects can not be copied. - RGBAImage(const RGBAImage &) = delete; - RGBAImage(RGBAImage &&) = delete; - RGBAImage &operator=(const RGBAImage &) = delete; - RGBAImage &operator=(RGBAImage &&) = delete; + RGBAImage(const RGBAImage &) = default; + RGBAImage(RGBAImage &&) noexcept = default; + RGBAImage &operator=(const RGBAImage &) = default; + RGBAImage &operator=(RGBAImage &&) noexcept = default; virtual ~RGBAImage(); int GetHeight() const { return height; } int GetWidth() const { return width; } -- cgit v1.2.3