diff --git a/include/ftxui/component/component.hpp b/include/ftxui/component/component.hpp index 1582e3b0..78d34e80 100644 --- a/include/ftxui/component/component.hpp +++ b/include/ftxui/component/component.hpp @@ -23,7 +23,7 @@ struct MenuEntryOption; template std::shared_ptr Make(Args&&... args) { - return std::make_shared(args...); + return std::make_shared(std::forward(args)...); } namespace Container { diff --git a/include/ftxui/util/ref.hpp b/include/ftxui/util/ref.hpp index ff1133ae..e806200c 100644 --- a/include/ftxui/util/ref.hpp +++ b/include/ftxui/util/ref.hpp @@ -27,7 +27,8 @@ template class Ref { public: Ref() {} - Ref(T t) : owned_(t) {} + Ref(const T& t) : owned_(t) {} + Ref(T&& t) : owned_(std::forward(t)) {} Ref(T* t) : address_(t) {} T& operator*() { return address_ ? *address_ : owned_; } T& operator()() { return address_ ? *address_ : owned_; }