diff options
author | Neil <nyamatongwe@gmail.com> | 2019-04-07 12:20:58 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2019-04-07 12:20:58 +1000 |
commit | d2bb3203067343b51bf3c543b331741f6fa4ad21 (patch) | |
tree | 84ca5bf493addc9912999858ce778562d20eb105 /src/XPM.h | |
parent | 33ca7ad72f783b2b9a9eef0b5d0dc8cd0629be69 (diff) | |
download | scintilla-mirror-d2bb3203067343b51bf3c543b331741f6fa4ad21.tar.gz |
Make XPM, RGBAImage, and LineMarker copyable and noexcept moveable.
This simplifies and optimizes their use in other classes and containers.
Diffstat (limited to 'src/XPM.h')
-rw-r--r-- | src/XPM.h | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -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; } |