Skip to content

Commit

Permalink
[terminal] Image: allow move semantics.
Browse files Browse the repository at this point in the history
  • Loading branch information
christianparpart committed Jul 15, 2021
1 parent 9c01cc0 commit dfacb3d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/terminal/Image.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class Image {

Image(Image const&) = delete;
Image& operator=(Image const&) = delete;
Image(Image&&) = delete;
Image& operator=(Image&&) = delete;
Image(Image&&) = default;
Image& operator=(Image&&) = default;

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

private:
Id const id_;
ImageFormat const format_;
Data const data_;
ImageSize const size_;
Id id_;
ImageFormat format_;
Data data_;
ImageSize size_;
};

/// Image resize hints are used to properly fit/fill the area to place the image onto.
Expand Down Expand Up @@ -197,6 +197,7 @@ inline bool operator<(ImageFragment const& a, ImageFragment const& b) noexcept
class ImagePool {
public:
using OnImageRemove = std::function<void(Image const*)>;

ImagePool(OnImageRemove _onImageRemove, Image::Id _nextImageId) :
nextImageId_{ _nextImageId },
images_{},
Expand Down

0 comments on commit dfacb3d

Please sign in to comment.