added read typed entity with foreign key

This commit is contained in:
2023-11-23 22:23:45 +01:00
parent 72bc6db6b3
commit 700cbc0652
4 changed files with 81 additions and 68 deletions
+6 -1
View File
@@ -16,6 +16,11 @@ public:
foreign() = default;
explicit foreign(Type *obj)
: obj_(obj) {}
foreign(const foreign&) = default;
foreign& operator=(const foreign&) = default;
foreign(foreign&&) noexcept = default;
foreign& operator=(foreign&&) noexcept = default;
~foreign() = default;
pointer operator->() { return obj_.get(); }
const value_type* operator->() const { return obj_.get(); }
@@ -24,7 +29,7 @@ public:
const value_type& operator*() const { return *obj_; }
private:
std::unique_ptr<value_type> obj_;
std::shared_ptr<value_type> obj_;
};
template<class Type, typename... Args>