From cd5569db2f69017fbafe72e4326421cc4194ceed Mon Sep 17 00:00:00 2001 From: emeric Date: Sat, 13 Apr 2024 14:26:54 +0200 Subject: [PATCH] Give a chance to construct an ObjectPtr by moving source --- src/libs/database/include/database/Object.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/database/include/database/Object.hpp b/src/libs/database/include/database/Object.hpp index 3c7452b5..5fa33f69 100644 --- a/src/libs/database/include/database/Object.hpp +++ b/src/libs/database/include/database/Object.hpp @@ -31,7 +31,8 @@ namespace lms::db { public: ObjectPtr() = default; - ObjectPtr(Wt::Dbo::ptr obj) : _obj{ obj } {} + ObjectPtr(const Wt::Dbo::ptr& obj) : _obj{ obj } {} + ObjectPtr(Wt::Dbo::ptr&& obj) : _obj{ std::move(obj) } {} const T* operator->() const { return _obj.get(); } operator bool() const { return _obj.get(); }