Skip to content

Commit dfacb3d

Browse files
[terminal] Image: allow move semantics.
1 parent 9c01cc0 commit dfacb3d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/terminal/Image.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ class Image {
6161

6262
Image(Image const&) = delete;
6363
Image& operator=(Image const&) = delete;
64-
Image(Image&&) = delete;
65-
Image& operator=(Image&&) = delete;
64+
Image(Image&&) = default;
65+
Image& operator=(Image&&) = default;
6666

6767
constexpr Id id() const noexcept { return id_; }
6868
constexpr ImageFormat format() const noexcept { return format_; }
@@ -72,10 +72,10 @@ class Image {
7272
constexpr Height height() const noexcept { return size_.height; }
7373

7474
private:
75-
Id const id_;
76-
ImageFormat const format_;
77-
Data const data_;
78-
ImageSize const size_;
75+
Id id_;
76+
ImageFormat format_;
77+
Data data_;
78+
ImageSize size_;
7979
};
8080

8181
/// Image resize hints are used to properly fit/fill the area to place the image onto.
@@ -197,6 +197,7 @@ inline bool operator<(ImageFragment const& a, ImageFragment const& b) noexcept
197197
class ImagePool {
198198
public:
199199
using OnImageRemove = std::function<void(Image const*)>;
200+
200201
ImagePool(OnImageRemove _onImageRemove, Image::Id _nextImageId) :
201202
nextImageId_{ _nextImageId },
202203
images_{},

0 commit comments

Comments
 (0)