diff --git a/include/ftxui/util/ref.hpp b/include/ftxui/util/ref.hpp index 1207af5..7871479 100644 --- a/include/ftxui/util/ref.hpp +++ b/include/ftxui/util/ref.hpp @@ -13,10 +13,11 @@ class ConstRef { public: ConstRef() = default; ConstRef(const ConstRef&) = default; - ConstRef(const T& t) : variant_(t) {} + ConstRef(ConstRef&&) = default; + ConstRef(T t) : variant_(std::move(t)) {} ConstRef(const T* t) : variant_(t) {} - // Make a "resetable" reference + // Make a "reseatable" reference ConstRef& operator=(const ConstRef&) = default; // Accessors: @@ -39,11 +40,11 @@ class Ref { public: Ref() = default; Ref(const Ref&) = default; - Ref(const T& t) : variant_(t) {} - Ref(T&& t) : variant_(std::forward(t)) {} + Ref(Ref&&) = default; + Ref(T t) : variant_(std::move(t)) {} Ref(T* t) : variant_(t) {} - // Make a "resetable" reference + // Make a "reseatable" reference. Ref& operator=(const Ref&) = default; // Accessors: diff --git a/src/ftxui/dom/canvas.cpp b/src/ftxui/dom/canvas.cpp index f42efb6..f6501fd 100644 --- a/src/ftxui/dom/canvas.cpp +++ b/src/ftxui/dom/canvas.cpp @@ -849,7 +849,7 @@ class CanvasNodeBase : public Node { Element canvas(ConstRef canvas) { class Impl : public CanvasNodeBase { public: - explicit Impl(ConstRef canvas) : canvas_(canvas) { + explicit Impl(ConstRef canvas) : canvas_(std::move(canvas)) { requirement_.min_x = (canvas_->width() + 1) / 2; requirement_.min_y = (canvas_->height() + 3) / 4; }